package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
)
type UpdateNewMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateNewMessageTypeID = 0x1f2b0afd
func (u *UpdateNewMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateNewMessage ) String () string {
if u == nil {
return "UpdateNewMessage(nil)"
}
type Alias UpdateNewMessage
return fmt .Sprintf ("UpdateNewMessage%+v" , Alias (*u ))
}
func (u *UpdateNewMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateNewMessage ) TypeID () uint32 {
return UpdateNewMessageTypeID
}
func (*UpdateNewMessage ) TypeName () string {
return "updateNewMessage"
}
func (u *UpdateNewMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewMessage" ,
ID : UpdateNewMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateNewMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewMessage#1f2b0afd as nil" )
}
b .PutID (UpdateNewMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewMessage#1f2b0afd as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewMessage#1f2b0afd: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewMessage#1f2b0afd: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateNewMessage ) GetMessage () (value MessageClass ) {
return u .Message
}
func (u *UpdateNewMessage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateNewMessage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateNewMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewMessage#1f2b0afd to nil" )
}
if err := b .ConsumeID (UpdateNewMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewMessage#1f2b0afd to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateNewMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewMessage {}
_ bin .Decoder = &UpdateNewMessage {}
_ bin .BareEncoder = &UpdateNewMessage {}
_ bin .BareDecoder = &UpdateNewMessage {}
_ UpdateClass = &UpdateNewMessage {}
)
type UpdateMessageID struct {
ID int
RandomID int64
}
const UpdateMessageIDTypeID = 0x4e90bfd6
func (u *UpdateMessageID ) Zero () bool {
if u == nil {
return true
}
if !(u .ID == 0 ) {
return false
}
if !(u .RandomID == 0 ) {
return false
}
return true
}
func (u *UpdateMessageID ) String () string {
if u == nil {
return "UpdateMessageID(nil)"
}
type Alias UpdateMessageID
return fmt .Sprintf ("UpdateMessageID%+v" , Alias (*u ))
}
func (u *UpdateMessageID ) FillFrom (from interface {
GetID () (value int )
GetRandomID () (value int64 )
}) {
u .ID = from .GetID ()
u .RandomID = from .GetRandomID ()
}
func (*UpdateMessageID ) TypeID () uint32 {
return UpdateMessageIDTypeID
}
func (*UpdateMessageID ) TypeName () string {
return "updateMessageID"
}
func (u *UpdateMessageID ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessageID" ,
ID : UpdateMessageIDTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "RandomID" ,
SchemaName : "random_id" ,
},
}
return typ
}
func (u *UpdateMessageID ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageID#4e90bfd6 as nil" )
}
b .PutID (UpdateMessageIDTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessageID ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageID#4e90bfd6 as nil" )
}
b .PutInt (u .ID )
b .PutLong (u .RandomID )
return nil
}
func (u *UpdateMessageID ) GetID () (value int ) {
return u .ID
}
func (u *UpdateMessageID ) GetRandomID () (value int64 ) {
return u .RandomID
}
func (u *UpdateMessageID ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageID#4e90bfd6 to nil" )
}
if err := b .ConsumeID (UpdateMessageIDTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessageID ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageID#4e90bfd6 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: field random_id: %w" , err )
}
u .RandomID = value
}
return nil
}
func (u UpdateMessageID ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessageID {}
_ bin .Decoder = &UpdateMessageID {}
_ bin .BareEncoder = &UpdateMessageID {}
_ bin .BareDecoder = &UpdateMessageID {}
_ UpdateClass = &UpdateMessageID {}
)
type UpdateDeleteMessages struct {
Messages []int
Pts int
PtsCount int
}
const UpdateDeleteMessagesTypeID = 0xa20db0e5
func (u *UpdateDeleteMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateDeleteMessages ) String () string {
if u == nil {
return "UpdateDeleteMessages(nil)"
}
type Alias UpdateDeleteMessages
return fmt .Sprintf ("UpdateDeleteMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteMessages ) FillFrom (from interface {
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateDeleteMessages ) TypeID () uint32 {
return UpdateDeleteMessagesTypeID
}
func (*UpdateDeleteMessages ) TypeName () string {
return "updateDeleteMessages"
}
func (u *UpdateDeleteMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteMessages" ,
ID : UpdateDeleteMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateDeleteMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteMessages#a20db0e5 as nil" )
}
b .PutID (UpdateDeleteMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteMessages#a20db0e5 as nil" )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateDeleteMessages ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdateDeleteMessages ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateDeleteMessages ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateDeleteMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteMessages#a20db0e5 to nil" )
}
if err := b .ConsumeID (UpdateDeleteMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteMessages#a20db0e5 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateDeleteMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteMessages {}
_ bin .Decoder = &UpdateDeleteMessages {}
_ bin .BareEncoder = &UpdateDeleteMessages {}
_ bin .BareDecoder = &UpdateDeleteMessages {}
_ UpdateClass = &UpdateDeleteMessages {}
)
type UpdateUserTyping struct {
UserID int
Action SendMessageActionClass
}
const UpdateUserTypingTypeID = 0x5c486927
func (u *UpdateUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateUserTyping ) String () string {
if u == nil {
return "UpdateUserTyping(nil)"
}
type Alias UpdateUserTyping
return fmt .Sprintf ("UpdateUserTyping%+v" , Alias (*u ))
}
func (u *UpdateUserTyping ) FillFrom (from interface {
GetUserID () (value int )
GetAction () (value SendMessageActionClass )
}) {
u .UserID = from .GetUserID ()
u .Action = from .GetAction ()
}
func (*UpdateUserTyping ) TypeID () uint32 {
return UpdateUserTypingTypeID
}
func (*UpdateUserTyping ) TypeName () string {
return "updateUserTyping"
}
func (u *UpdateUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserTyping" ,
ID : UpdateUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserTyping#5c486927 as nil" )
}
b .PutID (UpdateUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserTyping#5c486927 as nil" )
}
b .PutInt (u .UserID )
if u .Action == nil {
return fmt .Errorf ("unable to encode updateUserTyping#5c486927: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserTyping#5c486927: field action: %w" , err )
}
return nil
}
func (u *UpdateUserTyping ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateUserTyping ) GetAction () (value SendMessageActionClass ) {
return u .Action
}
func (u *UpdateUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserTyping#5c486927 to nil" )
}
if err := b .ConsumeID (UpdateUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#5c486927: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserTyping#5c486927 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#5c486927: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#5c486927: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u UpdateUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserTyping {}
_ bin .Decoder = &UpdateUserTyping {}
_ bin .BareEncoder = &UpdateUserTyping {}
_ bin .BareDecoder = &UpdateUserTyping {}
_ UpdateClass = &UpdateUserTyping {}
)
type UpdateChatUserTyping struct {
ChatID int
FromID PeerClass
Action SendMessageActionClass
}
const UpdateChatUserTypingTypeID = 0x86cadb6c
func (u *UpdateChatUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .FromID == nil ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateChatUserTyping ) String () string {
if u == nil {
return "UpdateChatUserTyping(nil)"
}
type Alias UpdateChatUserTyping
return fmt .Sprintf ("UpdateChatUserTyping%+v" , Alias (*u ))
}
func (u *UpdateChatUserTyping ) FillFrom (from interface {
GetChatID () (value int )
GetFromID () (value PeerClass )
GetAction () (value SendMessageActionClass )
}) {
u .ChatID = from .GetChatID ()
u .FromID = from .GetFromID ()
u .Action = from .GetAction ()
}
func (*UpdateChatUserTyping ) TypeID () uint32 {
return UpdateChatUserTypingTypeID
}
func (*UpdateChatUserTyping ) TypeName () string {
return "updateChatUserTyping"
}
func (u *UpdateChatUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatUserTyping" ,
ID : UpdateChatUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "FromID" ,
SchemaName : "from_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateChatUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatUserTyping#86cadb6c as nil" )
}
b .PutID (UpdateChatUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatUserTyping#86cadb6c as nil" )
}
b .PutInt (u .ChatID )
if u .FromID == nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#86cadb6c: field from_id is nil" )
}
if err := u .FromID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#86cadb6c: field from_id: %w" , err )
}
if u .Action == nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#86cadb6c: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#86cadb6c: field action: %w" , err )
}
return nil
}
func (u *UpdateChatUserTyping ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChatUserTyping ) GetFromID () (value PeerClass ) {
return u .FromID
}
func (u *UpdateChatUserTyping ) GetAction () (value SendMessageActionClass ) {
return u .Action
}
func (u *UpdateChatUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatUserTyping#86cadb6c to nil" )
}
if err := b .ConsumeID (UpdateChatUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#86cadb6c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatUserTyping#86cadb6c to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#86cadb6c: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#86cadb6c: field from_id: %w" , err )
}
u .FromID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#86cadb6c: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u UpdateChatUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatUserTyping {}
_ bin .Decoder = &UpdateChatUserTyping {}
_ bin .BareEncoder = &UpdateChatUserTyping {}
_ bin .BareDecoder = &UpdateChatUserTyping {}
_ UpdateClass = &UpdateChatUserTyping {}
)
type UpdateChatParticipants struct {
Participants ChatParticipantsClass
}
const UpdateChatParticipantsTypeID = 0x7761198
func (u *UpdateChatParticipants ) Zero () bool {
if u == nil {
return true
}
if !(u .Participants == nil ) {
return false
}
return true
}
func (u *UpdateChatParticipants ) String () string {
if u == nil {
return "UpdateChatParticipants(nil)"
}
type Alias UpdateChatParticipants
return fmt .Sprintf ("UpdateChatParticipants%+v" , Alias (*u ))
}
func (u *UpdateChatParticipants ) FillFrom (from interface {
GetParticipants () (value ChatParticipantsClass )
}) {
u .Participants = from .GetParticipants ()
}
func (*UpdateChatParticipants ) TypeID () uint32 {
return UpdateChatParticipantsTypeID
}
func (*UpdateChatParticipants ) TypeName () string {
return "updateChatParticipants"
}
func (u *UpdateChatParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipants" ,
ID : UpdateChatParticipantsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Participants" ,
SchemaName : "participants" ,
},
}
return typ
}
func (u *UpdateChatParticipants ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipants#7761198 as nil" )
}
b .PutID (UpdateChatParticipantsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipants ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipants#7761198 as nil" )
}
if u .Participants == nil {
return fmt .Errorf ("unable to encode updateChatParticipants#7761198: field participants is nil" )
}
if err := u .Participants .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipants#7761198: field participants: %w" , err )
}
return nil
}
func (u *UpdateChatParticipants ) GetParticipants () (value ChatParticipantsClass ) {
return u .Participants
}
func (u *UpdateChatParticipants ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipants#7761198 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipants#7761198: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipants ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipants#7761198 to nil" )
}
{
value , err := DecodeChatParticipants (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipants#7761198: field participants: %w" , err )
}
u .Participants = value
}
return nil
}
func (u UpdateChatParticipants ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipants {}
_ bin .Decoder = &UpdateChatParticipants {}
_ bin .BareEncoder = &UpdateChatParticipants {}
_ bin .BareDecoder = &UpdateChatParticipants {}
_ UpdateClass = &UpdateChatParticipants {}
)
type UpdateUserStatus struct {
UserID int
Status UserStatusClass
}
const UpdateUserStatusTypeID = 0x1bfbd823
func (u *UpdateUserStatus ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Status == nil ) {
return false
}
return true
}
func (u *UpdateUserStatus ) String () string {
if u == nil {
return "UpdateUserStatus(nil)"
}
type Alias UpdateUserStatus
return fmt .Sprintf ("UpdateUserStatus%+v" , Alias (*u ))
}
func (u *UpdateUserStatus ) FillFrom (from interface {
GetUserID () (value int )
GetStatus () (value UserStatusClass )
}) {
u .UserID = from .GetUserID ()
u .Status = from .GetStatus ()
}
func (*UpdateUserStatus ) TypeID () uint32 {
return UpdateUserStatusTypeID
}
func (*UpdateUserStatus ) TypeName () string {
return "updateUserStatus"
}
func (u *UpdateUserStatus ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserStatus" ,
ID : UpdateUserStatusTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Status" ,
SchemaName : "status" ,
},
}
return typ
}
func (u *UpdateUserStatus ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserStatus#1bfbd823 as nil" )
}
b .PutID (UpdateUserStatusTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserStatus ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserStatus#1bfbd823 as nil" )
}
b .PutInt (u .UserID )
if u .Status == nil {
return fmt .Errorf ("unable to encode updateUserStatus#1bfbd823: field status is nil" )
}
if err := u .Status .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserStatus#1bfbd823: field status: %w" , err )
}
return nil
}
func (u *UpdateUserStatus ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateUserStatus ) GetStatus () (value UserStatusClass ) {
return u .Status
}
func (u *UpdateUserStatus ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserStatus#1bfbd823 to nil" )
}
if err := b .ConsumeID (UpdateUserStatusTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#1bfbd823: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserStatus ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserStatus#1bfbd823 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#1bfbd823: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeUserStatus (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#1bfbd823: field status: %w" , err )
}
u .Status = value
}
return nil
}
func (u UpdateUserStatus ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserStatus {}
_ bin .Decoder = &UpdateUserStatus {}
_ bin .BareEncoder = &UpdateUserStatus {}
_ bin .BareDecoder = &UpdateUserStatus {}
_ UpdateClass = &UpdateUserStatus {}
)
type UpdateUserName struct {
UserID int
FirstName string
LastName string
Username string
}
const UpdateUserNameTypeID = 0xa7332b73
func (u *UpdateUserName ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .FirstName == "" ) {
return false
}
if !(u .LastName == "" ) {
return false
}
if !(u .Username == "" ) {
return false
}
return true
}
func (u *UpdateUserName ) String () string {
if u == nil {
return "UpdateUserName(nil)"
}
type Alias UpdateUserName
return fmt .Sprintf ("UpdateUserName%+v" , Alias (*u ))
}
func (u *UpdateUserName ) FillFrom (from interface {
GetUserID () (value int )
GetFirstName () (value string )
GetLastName () (value string )
GetUsername () (value string )
}) {
u .UserID = from .GetUserID ()
u .FirstName = from .GetFirstName ()
u .LastName = from .GetLastName ()
u .Username = from .GetUsername ()
}
func (*UpdateUserName ) TypeID () uint32 {
return UpdateUserNameTypeID
}
func (*UpdateUserName ) TypeName () string {
return "updateUserName"
}
func (u *UpdateUserName ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserName" ,
ID : UpdateUserNameTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "FirstName" ,
SchemaName : "first_name" ,
},
{
Name : "LastName" ,
SchemaName : "last_name" ,
},
{
Name : "Username" ,
SchemaName : "username" ,
},
}
return typ
}
func (u *UpdateUserName ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserName#a7332b73 as nil" )
}
b .PutID (UpdateUserNameTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserName ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserName#a7332b73 as nil" )
}
b .PutInt (u .UserID )
b .PutString (u .FirstName )
b .PutString (u .LastName )
b .PutString (u .Username )
return nil
}
func (u *UpdateUserName ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateUserName ) GetFirstName () (value string ) {
return u .FirstName
}
func (u *UpdateUserName ) GetLastName () (value string ) {
return u .LastName
}
func (u *UpdateUserName ) GetUsername () (value string ) {
return u .Username
}
func (u *UpdateUserName ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserName#a7332b73 to nil" )
}
if err := b .ConsumeID (UpdateUserNameTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7332b73: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserName ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserName#a7332b73 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7332b73: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7332b73: field first_name: %w" , err )
}
u .FirstName = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7332b73: field last_name: %w" , err )
}
u .LastName = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7332b73: field username: %w" , err )
}
u .Username = value
}
return nil
}
func (u UpdateUserName ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserName {}
_ bin .Decoder = &UpdateUserName {}
_ bin .BareEncoder = &UpdateUserName {}
_ bin .BareDecoder = &UpdateUserName {}
_ UpdateClass = &UpdateUserName {}
)
type UpdateUserPhoto struct {
UserID int
Date int
Photo UserProfilePhotoClass
Previous bool
}
const UpdateUserPhotoTypeID = 0x95313b0c
func (u *UpdateUserPhoto ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Photo == nil ) {
return false
}
if !(u .Previous == false ) {
return false
}
return true
}
func (u *UpdateUserPhoto ) String () string {
if u == nil {
return "UpdateUserPhoto(nil)"
}
type Alias UpdateUserPhoto
return fmt .Sprintf ("UpdateUserPhoto%+v" , Alias (*u ))
}
func (u *UpdateUserPhoto ) FillFrom (from interface {
GetUserID () (value int )
GetDate () (value int )
GetPhoto () (value UserProfilePhotoClass )
GetPrevious () (value bool )
}) {
u .UserID = from .GetUserID ()
u .Date = from .GetDate ()
u .Photo = from .GetPhoto ()
u .Previous = from .GetPrevious ()
}
func (*UpdateUserPhoto ) TypeID () uint32 {
return UpdateUserPhotoTypeID
}
func (*UpdateUserPhoto ) TypeName () string {
return "updateUserPhoto"
}
func (u *UpdateUserPhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserPhoto" ,
ID : UpdateUserPhotoTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Photo" ,
SchemaName : "photo" ,
},
{
Name : "Previous" ,
SchemaName : "previous" ,
},
}
return typ
}
func (u *UpdateUserPhoto ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhoto#95313b0c as nil" )
}
b .PutID (UpdateUserPhotoTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserPhoto ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhoto#95313b0c as nil" )
}
b .PutInt (u .UserID )
b .PutInt (u .Date )
if u .Photo == nil {
return fmt .Errorf ("unable to encode updateUserPhoto#95313b0c: field photo is nil" )
}
if err := u .Photo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserPhoto#95313b0c: field photo: %w" , err )
}
b .PutBool (u .Previous )
return nil
}
func (u *UpdateUserPhoto ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateUserPhoto ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateUserPhoto ) GetPhoto () (value UserProfilePhotoClass ) {
return u .Photo
}
func (u *UpdateUserPhoto ) GetPrevious () (value bool ) {
return u .Previous
}
func (u *UpdateUserPhoto ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhoto#95313b0c to nil" )
}
if err := b .ConsumeID (UpdateUserPhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserPhoto#95313b0c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserPhoto ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhoto#95313b0c to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhoto#95313b0c: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhoto#95313b0c: field date: %w" , err )
}
u .Date = value
}
{
value , err := DecodeUserProfilePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhoto#95313b0c: field photo: %w" , err )
}
u .Photo = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhoto#95313b0c: field previous: %w" , err )
}
u .Previous = value
}
return nil
}
func (u UpdateUserPhoto ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserPhoto {}
_ bin .Decoder = &UpdateUserPhoto {}
_ bin .BareEncoder = &UpdateUserPhoto {}
_ bin .BareDecoder = &UpdateUserPhoto {}
_ UpdateClass = &UpdateUserPhoto {}
)
type UpdateNewEncryptedMessage struct {
Message EncryptedMessageClass
Qts int
}
const UpdateNewEncryptedMessageTypeID = 0x12bcbd9a
func (u *UpdateNewEncryptedMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateNewEncryptedMessage ) String () string {
if u == nil {
return "UpdateNewEncryptedMessage(nil)"
}
type Alias UpdateNewEncryptedMessage
return fmt .Sprintf ("UpdateNewEncryptedMessage%+v" , Alias (*u ))
}
func (u *UpdateNewEncryptedMessage ) FillFrom (from interface {
GetMessage () (value EncryptedMessageClass )
GetQts () (value int )
}) {
u .Message = from .GetMessage ()
u .Qts = from .GetQts ()
}
func (*UpdateNewEncryptedMessage ) TypeID () uint32 {
return UpdateNewEncryptedMessageTypeID
}
func (*UpdateNewEncryptedMessage ) TypeName () string {
return "updateNewEncryptedMessage"
}
func (u *UpdateNewEncryptedMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewEncryptedMessage" ,
ID : UpdateNewEncryptedMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateNewEncryptedMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewEncryptedMessage#12bcbd9a as nil" )
}
b .PutID (UpdateNewEncryptedMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewEncryptedMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewEncryptedMessage#12bcbd9a as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewEncryptedMessage#12bcbd9a: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewEncryptedMessage#12bcbd9a: field message: %w" , err )
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateNewEncryptedMessage ) GetMessage () (value EncryptedMessageClass ) {
return u .Message
}
func (u *UpdateNewEncryptedMessage ) GetQts () (value int ) {
return u .Qts
}
func (u *UpdateNewEncryptedMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewEncryptedMessage#12bcbd9a to nil" )
}
if err := b .ConsumeID (UpdateNewEncryptedMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewEncryptedMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewEncryptedMessage#12bcbd9a to nil" )
}
{
value , err := DecodeEncryptedMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u UpdateNewEncryptedMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewEncryptedMessage {}
_ bin .Decoder = &UpdateNewEncryptedMessage {}
_ bin .BareEncoder = &UpdateNewEncryptedMessage {}
_ bin .BareDecoder = &UpdateNewEncryptedMessage {}
_ UpdateClass = &UpdateNewEncryptedMessage {}
)
type UpdateEncryptedChatTyping struct {
ChatID int
}
const UpdateEncryptedChatTypingTypeID = 0x1710f156
func (u *UpdateEncryptedChatTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
return true
}
func (u *UpdateEncryptedChatTyping ) String () string {
if u == nil {
return "UpdateEncryptedChatTyping(nil)"
}
type Alias UpdateEncryptedChatTyping
return fmt .Sprintf ("UpdateEncryptedChatTyping%+v" , Alias (*u ))
}
func (u *UpdateEncryptedChatTyping ) FillFrom (from interface {
GetChatID () (value int )
}) {
u .ChatID = from .GetChatID ()
}
func (*UpdateEncryptedChatTyping ) TypeID () uint32 {
return UpdateEncryptedChatTypingTypeID
}
func (*UpdateEncryptedChatTyping ) TypeName () string {
return "updateEncryptedChatTyping"
}
func (u *UpdateEncryptedChatTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryptedChatTyping" ,
ID : UpdateEncryptedChatTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (u *UpdateEncryptedChatTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedChatTyping#1710f156 as nil" )
}
b .PutID (UpdateEncryptedChatTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryptedChatTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedChatTyping#1710f156 as nil" )
}
b .PutInt (u .ChatID )
return nil
}
func (u *UpdateEncryptedChatTyping ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateEncryptedChatTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedChatTyping#1710f156 to nil" )
}
if err := b .ConsumeID (UpdateEncryptedChatTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryptedChatTyping#1710f156: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryptedChatTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedChatTyping#1710f156 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedChatTyping#1710f156: field chat_id: %w" , err )
}
u .ChatID = value
}
return nil
}
func (u UpdateEncryptedChatTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryptedChatTyping {}
_ bin .Decoder = &UpdateEncryptedChatTyping {}
_ bin .BareEncoder = &UpdateEncryptedChatTyping {}
_ bin .BareDecoder = &UpdateEncryptedChatTyping {}
_ UpdateClass = &UpdateEncryptedChatTyping {}
)
type UpdateEncryption struct {
Chat EncryptedChatClass
Date int
}
const UpdateEncryptionTypeID = 0xb4a2e88d
func (u *UpdateEncryption ) Zero () bool {
if u == nil {
return true
}
if !(u .Chat == nil ) {
return false
}
if !(u .Date == 0 ) {
return false
}
return true
}
func (u *UpdateEncryption ) String () string {
if u == nil {
return "UpdateEncryption(nil)"
}
type Alias UpdateEncryption
return fmt .Sprintf ("UpdateEncryption%+v" , Alias (*u ))
}
func (u *UpdateEncryption ) FillFrom (from interface {
GetChat () (value EncryptedChatClass )
GetDate () (value int )
}) {
u .Chat = from .GetChat ()
u .Date = from .GetDate ()
}
func (*UpdateEncryption ) TypeID () uint32 {
return UpdateEncryptionTypeID
}
func (*UpdateEncryption ) TypeName () string {
return "updateEncryption"
}
func (u *UpdateEncryption ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryption" ,
ID : UpdateEncryptionTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chat" ,
SchemaName : "chat" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (u *UpdateEncryption ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryption#b4a2e88d as nil" )
}
b .PutID (UpdateEncryptionTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryption ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryption#b4a2e88d as nil" )
}
if u .Chat == nil {
return fmt .Errorf ("unable to encode updateEncryption#b4a2e88d: field chat is nil" )
}
if err := u .Chat .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEncryption#b4a2e88d: field chat: %w" , err )
}
b .PutInt (u .Date )
return nil
}
func (u *UpdateEncryption ) GetChat () (value EncryptedChatClass ) {
return u .Chat
}
func (u *UpdateEncryption ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateEncryption ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryption#b4a2e88d to nil" )
}
if err := b .ConsumeID (UpdateEncryptionTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryption ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryption#b4a2e88d to nil" )
}
{
value , err := DecodeEncryptedChat (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: field chat: %w" , err )
}
u .Chat = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: field date: %w" , err )
}
u .Date = value
}
return nil
}
func (u UpdateEncryption ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryption {}
_ bin .Decoder = &UpdateEncryption {}
_ bin .BareEncoder = &UpdateEncryption {}
_ bin .BareDecoder = &UpdateEncryption {}
_ UpdateClass = &UpdateEncryption {}
)
type UpdateEncryptedMessagesRead struct {
ChatID int
MaxDate int
Date int
}
const UpdateEncryptedMessagesReadTypeID = 0x38fe25b7
func (u *UpdateEncryptedMessagesRead ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .MaxDate == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
return true
}
func (u *UpdateEncryptedMessagesRead ) String () string {
if u == nil {
return "UpdateEncryptedMessagesRead(nil)"
}
type Alias UpdateEncryptedMessagesRead
return fmt .Sprintf ("UpdateEncryptedMessagesRead%+v" , Alias (*u ))
}
func (u *UpdateEncryptedMessagesRead ) FillFrom (from interface {
GetChatID () (value int )
GetMaxDate () (value int )
GetDate () (value int )
}) {
u .ChatID = from .GetChatID ()
u .MaxDate = from .GetMaxDate ()
u .Date = from .GetDate ()
}
func (*UpdateEncryptedMessagesRead ) TypeID () uint32 {
return UpdateEncryptedMessagesReadTypeID
}
func (*UpdateEncryptedMessagesRead ) TypeName () string {
return "updateEncryptedMessagesRead"
}
func (u *UpdateEncryptedMessagesRead ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryptedMessagesRead" ,
ID : UpdateEncryptedMessagesReadTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "MaxDate" ,
SchemaName : "max_date" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (u *UpdateEncryptedMessagesRead ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedMessagesRead#38fe25b7 as nil" )
}
b .PutID (UpdateEncryptedMessagesReadTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryptedMessagesRead ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedMessagesRead#38fe25b7 as nil" )
}
b .PutInt (u .ChatID )
b .PutInt (u .MaxDate )
b .PutInt (u .Date )
return nil
}
func (u *UpdateEncryptedMessagesRead ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateEncryptedMessagesRead ) GetMaxDate () (value int ) {
return u .MaxDate
}
func (u *UpdateEncryptedMessagesRead ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateEncryptedMessagesRead ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedMessagesRead#38fe25b7 to nil" )
}
if err := b .ConsumeID (UpdateEncryptedMessagesReadTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryptedMessagesRead ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedMessagesRead#38fe25b7 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field max_date: %w" , err )
}
u .MaxDate = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field date: %w" , err )
}
u .Date = value
}
return nil
}
func (u UpdateEncryptedMessagesRead ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryptedMessagesRead {}
_ bin .Decoder = &UpdateEncryptedMessagesRead {}
_ bin .BareEncoder = &UpdateEncryptedMessagesRead {}
_ bin .BareDecoder = &UpdateEncryptedMessagesRead {}
_ UpdateClass = &UpdateEncryptedMessagesRead {}
)
type UpdateChatParticipantAdd struct {
ChatID int
UserID int
InviterID int
Date int
Version int
}
const UpdateChatParticipantAddTypeID = 0xea4b0e5c
func (u *UpdateChatParticipantAdd ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .InviterID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantAdd ) String () string {
if u == nil {
return "UpdateChatParticipantAdd(nil)"
}
type Alias UpdateChatParticipantAdd
return fmt .Sprintf ("UpdateChatParticipantAdd%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantAdd ) FillFrom (from interface {
GetChatID () (value int )
GetUserID () (value int )
GetInviterID () (value int )
GetDate () (value int )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .InviterID = from .GetInviterID ()
u .Date = from .GetDate ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantAdd ) TypeID () uint32 {
return UpdateChatParticipantAddTypeID
}
func (*UpdateChatParticipantAdd ) TypeName () string {
return "updateChatParticipantAdd"
}
func (u *UpdateChatParticipantAdd ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantAdd" ,
ID : UpdateChatParticipantAddTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "InviterID" ,
SchemaName : "inviter_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantAdd ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdd#ea4b0e5c as nil" )
}
b .PutID (UpdateChatParticipantAddTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantAdd ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdd#ea4b0e5c as nil" )
}
b .PutInt (u .ChatID )
b .PutInt (u .UserID )
b .PutInt (u .InviterID )
b .PutInt (u .Date )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantAdd ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChatParticipantAdd ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateChatParticipantAdd ) GetInviterID () (value int ) {
return u .InviterID
}
func (u *UpdateChatParticipantAdd ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateChatParticipantAdd ) GetVersion () (value int ) {
return u .Version
}
func (u *UpdateChatParticipantAdd ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdd#ea4b0e5c to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantAddTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantAdd ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdd#ea4b0e5c to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: field inviter_id: %w" , err )
}
u .InviterID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#ea4b0e5c: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u UpdateChatParticipantAdd ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantAdd {}
_ bin .Decoder = &UpdateChatParticipantAdd {}
_ bin .BareEncoder = &UpdateChatParticipantAdd {}
_ bin .BareDecoder = &UpdateChatParticipantAdd {}
_ UpdateClass = &UpdateChatParticipantAdd {}
)
type UpdateChatParticipantDelete struct {
ChatID int
UserID int
Version int
}
const UpdateChatParticipantDeleteTypeID = 0x6e5f8c22
func (u *UpdateChatParticipantDelete ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantDelete ) String () string {
if u == nil {
return "UpdateChatParticipantDelete(nil)"
}
type Alias UpdateChatParticipantDelete
return fmt .Sprintf ("UpdateChatParticipantDelete%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantDelete ) FillFrom (from interface {
GetChatID () (value int )
GetUserID () (value int )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantDelete ) TypeID () uint32 {
return UpdateChatParticipantDeleteTypeID
}
func (*UpdateChatParticipantDelete ) TypeName () string {
return "updateChatParticipantDelete"
}
func (u *UpdateChatParticipantDelete ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantDelete" ,
ID : UpdateChatParticipantDeleteTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantDelete ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantDelete#6e5f8c22 as nil" )
}
b .PutID (UpdateChatParticipantDeleteTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantDelete ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantDelete#6e5f8c22 as nil" )
}
b .PutInt (u .ChatID )
b .PutInt (u .UserID )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantDelete ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChatParticipantDelete ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateChatParticipantDelete ) GetVersion () (value int ) {
return u .Version
}
func (u *UpdateChatParticipantDelete ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantDelete#6e5f8c22 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantDeleteTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#6e5f8c22: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantDelete ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantDelete#6e5f8c22 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#6e5f8c22: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#6e5f8c22: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#6e5f8c22: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u UpdateChatParticipantDelete ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantDelete {}
_ bin .Decoder = &UpdateChatParticipantDelete {}
_ bin .BareEncoder = &UpdateChatParticipantDelete {}
_ bin .BareDecoder = &UpdateChatParticipantDelete {}
_ UpdateClass = &UpdateChatParticipantDelete {}
)
type UpdateDCOptions struct {
DCOptions []DCOption
}
const UpdateDCOptionsTypeID = 0x8e5e9873
func (u *UpdateDCOptions ) Zero () bool {
if u == nil {
return true
}
if !(u .DCOptions == nil ) {
return false
}
return true
}
func (u *UpdateDCOptions ) String () string {
if u == nil {
return "UpdateDCOptions(nil)"
}
type Alias UpdateDCOptions
return fmt .Sprintf ("UpdateDCOptions%+v" , Alias (*u ))
}
func (u *UpdateDCOptions ) FillFrom (from interface {
GetDCOptions () (value []DCOption )
}) {
u .DCOptions = from .GetDCOptions ()
}
func (*UpdateDCOptions ) TypeID () uint32 {
return UpdateDCOptionsTypeID
}
func (*UpdateDCOptions ) TypeName () string {
return "updateDcOptions"
}
func (u *UpdateDCOptions ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDcOptions" ,
ID : UpdateDCOptionsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DCOptions" ,
SchemaName : "dc_options" ,
},
}
return typ
}
func (u *UpdateDCOptions ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDcOptions#8e5e9873 as nil" )
}
b .PutID (UpdateDCOptionsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDCOptions ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDcOptions#8e5e9873 as nil" )
}
b .PutVectorHeader (len (u .DCOptions ))
for idx , v := range u .DCOptions {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDcOptions#8e5e9873: field dc_options element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateDCOptions ) GetDCOptions () (value []DCOption ) {
return u .DCOptions
}
func (u *UpdateDCOptions ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDcOptions#8e5e9873 to nil" )
}
if err := b .ConsumeID (UpdateDCOptionsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDCOptions ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDcOptions#8e5e9873 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: field dc_options: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value DCOption
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: field dc_options: %w" , err )
}
u .DCOptions = append (u .DCOptions , value )
}
}
return nil
}
func (u UpdateDCOptions ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDCOptions {}
_ bin .Decoder = &UpdateDCOptions {}
_ bin .BareEncoder = &UpdateDCOptions {}
_ bin .BareDecoder = &UpdateDCOptions {}
_ UpdateClass = &UpdateDCOptions {}
)
type UpdateNotifySettings struct {
Peer NotifyPeerClass
NotifySettings PeerNotifySettings
}
const UpdateNotifySettingsTypeID = 0xbec268ef
func (u *UpdateNotifySettings ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .NotifySettings .Zero ()) {
return false
}
return true
}
func (u *UpdateNotifySettings ) String () string {
if u == nil {
return "UpdateNotifySettings(nil)"
}
type Alias UpdateNotifySettings
return fmt .Sprintf ("UpdateNotifySettings%+v" , Alias (*u ))
}
func (u *UpdateNotifySettings ) FillFrom (from interface {
GetPeer () (value NotifyPeerClass )
GetNotifySettings () (value PeerNotifySettings )
}) {
u .Peer = from .GetPeer ()
u .NotifySettings = from .GetNotifySettings ()
}
func (*UpdateNotifySettings ) TypeID () uint32 {
return UpdateNotifySettingsTypeID
}
func (*UpdateNotifySettings ) TypeName () string {
return "updateNotifySettings"
}
func (u *UpdateNotifySettings ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNotifySettings" ,
ID : UpdateNotifySettingsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "NotifySettings" ,
SchemaName : "notify_settings" ,
},
}
return typ
}
func (u *UpdateNotifySettings ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNotifySettings#bec268ef as nil" )
}
b .PutID (UpdateNotifySettingsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNotifySettings ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNotifySettings#bec268ef as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field peer: %w" , err )
}
if err := u .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field notify_settings: %w" , err )
}
return nil
}
func (u *UpdateNotifySettings ) GetPeer () (value NotifyPeerClass ) {
return u .Peer
}
func (u *UpdateNotifySettings ) GetNotifySettings () (value PeerNotifySettings ) {
return u .NotifySettings
}
func (u *UpdateNotifySettings ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNotifySettings#bec268ef to nil" )
}
if err := b .ConsumeID (UpdateNotifySettingsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNotifySettings ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNotifySettings#bec268ef to nil" )
}
{
value , err := DecodeNotifyPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: field notify_settings: %w" , err )
}
}
return nil
}
func (u UpdateNotifySettings ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNotifySettings {}
_ bin .Decoder = &UpdateNotifySettings {}
_ bin .BareEncoder = &UpdateNotifySettings {}
_ bin .BareDecoder = &UpdateNotifySettings {}
_ UpdateClass = &UpdateNotifySettings {}
)
type UpdateServiceNotification struct {
Flags bin .Fields
Popup bool
InboxDate int
Type string
Message string
Media MessageMediaClass
Entities []MessageEntityClass
}
const UpdateServiceNotificationTypeID = 0xebe46819
func (u *UpdateServiceNotification ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Popup == false ) {
return false
}
if !(u .InboxDate == 0 ) {
return false
}
if !(u .Type == "" ) {
return false
}
if !(u .Message == "" ) {
return false
}
if !(u .Media == nil ) {
return false
}
if !(u .Entities == nil ) {
return false
}
return true
}
func (u *UpdateServiceNotification ) String () string {
if u == nil {
return "UpdateServiceNotification(nil)"
}
type Alias UpdateServiceNotification
return fmt .Sprintf ("UpdateServiceNotification%+v" , Alias (*u ))
}
func (u *UpdateServiceNotification ) FillFrom (from interface {
GetPopup () (value bool )
GetInboxDate () (value int , ok bool )
GetType () (value string )
GetMessage () (value string )
GetMedia () (value MessageMediaClass )
GetEntities () (value []MessageEntityClass )
}) {
u .Popup = from .GetPopup ()
if val , ok := from .GetInboxDate (); ok {
u .InboxDate = val
}
u .Type = from .GetType ()
u .Message = from .GetMessage ()
u .Media = from .GetMedia ()
u .Entities = from .GetEntities ()
}
func (*UpdateServiceNotification ) TypeID () uint32 {
return UpdateServiceNotificationTypeID
}
func (*UpdateServiceNotification ) TypeName () string {
return "updateServiceNotification"
}
func (u *UpdateServiceNotification ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateServiceNotification" ,
ID : UpdateServiceNotificationTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Popup" ,
SchemaName : "popup" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "InboxDate" ,
SchemaName : "inbox_date" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Media" ,
SchemaName : "media" ,
},
{
Name : "Entities" ,
SchemaName : "entities" ,
},
}
return typ
}
func (u *UpdateServiceNotification ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateServiceNotification#ebe46819 as nil" )
}
b .PutID (UpdateServiceNotificationTypeID )
return u .EncodeBare (b )
}
func (u *UpdateServiceNotification ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateServiceNotification#ebe46819 as nil" )
}
if !(u .Popup == false ) {
u .Flags .Set (0 )
}
if !(u .InboxDate == 0 ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .InboxDate )
}
b .PutString (u .Type )
b .PutString (u .Message )
if u .Media == nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field media is nil" )
}
if err := u .Media .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field media: %w" , err )
}
b .PutVectorHeader (len (u .Entities ))
for idx , v := range u .Entities {
if v == nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field entities element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field entities element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateServiceNotification ) SetPopup (value bool ) {
if value {
u .Flags .Set (0 )
u .Popup = true
} else {
u .Flags .Unset (0 )
u .Popup = false
}
}
func (u *UpdateServiceNotification ) GetPopup () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdateServiceNotification ) SetInboxDate (value int ) {
u .Flags .Set (1 )
u .InboxDate = value
}
func (u *UpdateServiceNotification ) GetInboxDate () (value int , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .InboxDate , true
}
func (u *UpdateServiceNotification ) GetType () (value string ) {
return u .Type
}
func (u *UpdateServiceNotification ) GetMessage () (value string ) {
return u .Message
}
func (u *UpdateServiceNotification ) GetMedia () (value MessageMediaClass ) {
return u .Media
}
func (u *UpdateServiceNotification ) GetEntities () (value []MessageEntityClass ) {
return u .Entities
}
func (u *UpdateServiceNotification ) MapEntities () (value MessageEntityClassArray ) {
return MessageEntityClassArray (u .Entities )
}
func (u *UpdateServiceNotification ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateServiceNotification#ebe46819 to nil" )
}
if err := b .ConsumeID (UpdateServiceNotificationTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateServiceNotification ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateServiceNotification#ebe46819 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field flags: %w" , err )
}
}
u .Popup = u .Flags .Has (0 )
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field inbox_date: %w" , err )
}
u .InboxDate = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field type: %w" , err )
}
u .Type = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field message: %w" , err )
}
u .Message = value
}
{
value , err := DecodeMessageMedia (b )
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field media: %w" , err )
}
u .Media = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field entities: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeMessageEntity (b )
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field entities: %w" , err )
}
u .Entities = append (u .Entities , value )
}
}
return nil
}
func (u UpdateServiceNotification ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateServiceNotification {}
_ bin .Decoder = &UpdateServiceNotification {}
_ bin .BareEncoder = &UpdateServiceNotification {}
_ bin .BareDecoder = &UpdateServiceNotification {}
_ UpdateClass = &UpdateServiceNotification {}
)
type UpdatePrivacy struct {
Key PrivacyKeyClass
Rules []PrivacyRuleClass
}
const UpdatePrivacyTypeID = 0xee3b272a
func (u *UpdatePrivacy ) Zero () bool {
if u == nil {
return true
}
if !(u .Key == nil ) {
return false
}
if !(u .Rules == nil ) {
return false
}
return true
}
func (u *UpdatePrivacy ) String () string {
if u == nil {
return "UpdatePrivacy(nil)"
}
type Alias UpdatePrivacy
return fmt .Sprintf ("UpdatePrivacy%+v" , Alias (*u ))
}
func (u *UpdatePrivacy ) FillFrom (from interface {
GetKey () (value PrivacyKeyClass )
GetRules () (value []PrivacyRuleClass )
}) {
u .Key = from .GetKey ()
u .Rules = from .GetRules ()
}
func (*UpdatePrivacy ) TypeID () uint32 {
return UpdatePrivacyTypeID
}
func (*UpdatePrivacy ) TypeName () string {
return "updatePrivacy"
}
func (u *UpdatePrivacy ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePrivacy" ,
ID : UpdatePrivacyTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Key" ,
SchemaName : "key" ,
},
{
Name : "Rules" ,
SchemaName : "rules" ,
},
}
return typ
}
func (u *UpdatePrivacy ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePrivacy#ee3b272a as nil" )
}
b .PutID (UpdatePrivacyTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePrivacy ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePrivacy#ee3b272a as nil" )
}
if u .Key == nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field key is nil" )
}
if err := u .Key .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field key: %w" , err )
}
b .PutVectorHeader (len (u .Rules ))
for idx , v := range u .Rules {
if v == nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field rules element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field rules element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdatePrivacy ) GetKey () (value PrivacyKeyClass ) {
return u .Key
}
func (u *UpdatePrivacy ) GetRules () (value []PrivacyRuleClass ) {
return u .Rules
}
func (u *UpdatePrivacy ) MapRules () (value PrivacyRuleClassArray ) {
return PrivacyRuleClassArray (u .Rules )
}
func (u *UpdatePrivacy ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePrivacy#ee3b272a to nil" )
}
if err := b .ConsumeID (UpdatePrivacyTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePrivacy ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePrivacy#ee3b272a to nil" )
}
{
value , err := DecodePrivacyKey (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field key: %w" , err )
}
u .Key = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field rules: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePrivacyRule (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field rules: %w" , err )
}
u .Rules = append (u .Rules , value )
}
}
return nil
}
func (u UpdatePrivacy ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePrivacy {}
_ bin .Decoder = &UpdatePrivacy {}
_ bin .BareEncoder = &UpdatePrivacy {}
_ bin .BareDecoder = &UpdatePrivacy {}
_ UpdateClass = &UpdatePrivacy {}
)
type UpdateUserPhone struct {
UserID int
Phone string
}
const UpdateUserPhoneTypeID = 0x12b9417b
func (u *UpdateUserPhone ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Phone == "" ) {
return false
}
return true
}
func (u *UpdateUserPhone ) String () string {
if u == nil {
return "UpdateUserPhone(nil)"
}
type Alias UpdateUserPhone
return fmt .Sprintf ("UpdateUserPhone%+v" , Alias (*u ))
}
func (u *UpdateUserPhone ) FillFrom (from interface {
GetUserID () (value int )
GetPhone () (value string )
}) {
u .UserID = from .GetUserID ()
u .Phone = from .GetPhone ()
}
func (*UpdateUserPhone ) TypeID () uint32 {
return UpdateUserPhoneTypeID
}
func (*UpdateUserPhone ) TypeName () string {
return "updateUserPhone"
}
func (u *UpdateUserPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserPhone" ,
ID : UpdateUserPhoneTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Phone" ,
SchemaName : "phone" ,
},
}
return typ
}
func (u *UpdateUserPhone ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhone#12b9417b as nil" )
}
b .PutID (UpdateUserPhoneTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserPhone ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhone#12b9417b as nil" )
}
b .PutInt (u .UserID )
b .PutString (u .Phone )
return nil
}
func (u *UpdateUserPhone ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateUserPhone ) GetPhone () (value string ) {
return u .Phone
}
func (u *UpdateUserPhone ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhone#12b9417b to nil" )
}
if err := b .ConsumeID (UpdateUserPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#12b9417b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserPhone ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhone#12b9417b to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#12b9417b: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#12b9417b: field phone: %w" , err )
}
u .Phone = value
}
return nil
}
func (u UpdateUserPhone ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserPhone {}
_ bin .Decoder = &UpdateUserPhone {}
_ bin .BareEncoder = &UpdateUserPhone {}
_ bin .BareDecoder = &UpdateUserPhone {}
_ UpdateClass = &UpdateUserPhone {}
)
type UpdateReadHistoryInbox struct {
Flags bin .Fields
FolderID int
Peer PeerClass
MaxID int
StillUnreadCount int
Pts int
PtsCount int
}
const UpdateReadHistoryInboxTypeID = 0x9c974fdf
func (u *UpdateReadHistoryInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .StillUnreadCount == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateReadHistoryInbox ) String () string {
if u == nil {
return "UpdateReadHistoryInbox(nil)"
}
type Alias UpdateReadHistoryInbox
return fmt .Sprintf ("UpdateReadHistoryInbox%+v" , Alias (*u ))
}
func (u *UpdateReadHistoryInbox ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetPeer () (value PeerClass )
GetMaxID () (value int )
GetStillUnreadCount () (value int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .Peer = from .GetPeer ()
u .MaxID = from .GetMaxID ()
u .StillUnreadCount = from .GetStillUnreadCount ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateReadHistoryInbox ) TypeID () uint32 {
return UpdateReadHistoryInboxTypeID
}
func (*UpdateReadHistoryInbox ) TypeName () string {
return "updateReadHistoryInbox"
}
func (u *UpdateReadHistoryInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadHistoryInbox" ,
ID : UpdateReadHistoryInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "StillUnreadCount" ,
SchemaName : "still_unread_count" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateReadHistoryInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryInbox#9c974fdf as nil" )
}
b .PutID (UpdateReadHistoryInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadHistoryInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryInbox#9c974fdf as nil" )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field flags: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .FolderID )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field peer: %w" , err )
}
b .PutInt (u .MaxID )
b .PutInt (u .StillUnreadCount )
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateReadHistoryInbox ) SetFolderID (value int ) {
u .Flags .Set (0 )
u .FolderID = value
}
func (u *UpdateReadHistoryInbox ) GetFolderID () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateReadHistoryInbox ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateReadHistoryInbox ) GetMaxID () (value int ) {
return u .MaxID
}
func (u *UpdateReadHistoryInbox ) GetStillUnreadCount () (value int ) {
return u .StillUnreadCount
}
func (u *UpdateReadHistoryInbox ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateReadHistoryInbox ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateReadHistoryInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryInbox#9c974fdf to nil" )
}
if err := b .ConsumeID (UpdateReadHistoryInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadHistoryInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryInbox#9c974fdf to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field flags: %w" , err )
}
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field still_unread_count: %w" , err )
}
u .StillUnreadCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateReadHistoryInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadHistoryInbox {}
_ bin .Decoder = &UpdateReadHistoryInbox {}
_ bin .BareEncoder = &UpdateReadHistoryInbox {}
_ bin .BareDecoder = &UpdateReadHistoryInbox {}
_ UpdateClass = &UpdateReadHistoryInbox {}
)
type UpdateReadHistoryOutbox struct {
Peer PeerClass
MaxID int
Pts int
PtsCount int
}
const UpdateReadHistoryOutboxTypeID = 0x2f2f21bf
func (u *UpdateReadHistoryOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateReadHistoryOutbox ) String () string {
if u == nil {
return "UpdateReadHistoryOutbox(nil)"
}
type Alias UpdateReadHistoryOutbox
return fmt .Sprintf ("UpdateReadHistoryOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadHistoryOutbox ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMaxID () (value int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Peer = from .GetPeer ()
u .MaxID = from .GetMaxID ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateReadHistoryOutbox ) TypeID () uint32 {
return UpdateReadHistoryOutboxTypeID
}
func (*UpdateReadHistoryOutbox ) TypeName () string {
return "updateReadHistoryOutbox"
}
func (u *UpdateReadHistoryOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadHistoryOutbox" ,
ID : UpdateReadHistoryOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateReadHistoryOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryOutbox#2f2f21bf as nil" )
}
b .PutID (UpdateReadHistoryOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadHistoryOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryOutbox#2f2f21bf as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer: %w" , err )
}
b .PutInt (u .MaxID )
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateReadHistoryOutbox ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateReadHistoryOutbox ) GetMaxID () (value int ) {
return u .MaxID
}
func (u *UpdateReadHistoryOutbox ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateReadHistoryOutbox ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateReadHistoryOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryOutbox#2f2f21bf to nil" )
}
if err := b .ConsumeID (UpdateReadHistoryOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadHistoryOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryOutbox#2f2f21bf to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateReadHistoryOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadHistoryOutbox {}
_ bin .Decoder = &UpdateReadHistoryOutbox {}
_ bin .BareEncoder = &UpdateReadHistoryOutbox {}
_ bin .BareDecoder = &UpdateReadHistoryOutbox {}
_ UpdateClass = &UpdateReadHistoryOutbox {}
)
type UpdateWebPage struct {
Webpage WebPageClass
Pts int
PtsCount int
}
const UpdateWebPageTypeID = 0x7f891213
func (u *UpdateWebPage ) Zero () bool {
if u == nil {
return true
}
if !(u .Webpage == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateWebPage ) String () string {
if u == nil {
return "UpdateWebPage(nil)"
}
type Alias UpdateWebPage
return fmt .Sprintf ("UpdateWebPage%+v" , Alias (*u ))
}
func (u *UpdateWebPage ) FillFrom (from interface {
GetWebpage () (value WebPageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Webpage = from .GetWebpage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateWebPage ) TypeID () uint32 {
return UpdateWebPageTypeID
}
func (*UpdateWebPage ) TypeName () string {
return "updateWebPage"
}
func (u *UpdateWebPage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateWebPage" ,
ID : UpdateWebPageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Webpage" ,
SchemaName : "webpage" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateWebPage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebPage#7f891213 as nil" )
}
b .PutID (UpdateWebPageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateWebPage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebPage#7f891213 as nil" )
}
if u .Webpage == nil {
return fmt .Errorf ("unable to encode updateWebPage#7f891213: field webpage is nil" )
}
if err := u .Webpage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateWebPage#7f891213: field webpage: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateWebPage ) GetWebpage () (value WebPageClass ) {
return u .Webpage
}
func (u *UpdateWebPage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateWebPage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateWebPage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebPage#7f891213 to nil" )
}
if err := b .ConsumeID (UpdateWebPageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateWebPage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebPage#7f891213 to nil" )
}
{
value , err := DecodeWebPage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field webpage: %w" , err )
}
u .Webpage = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateWebPage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateWebPage {}
_ bin .Decoder = &UpdateWebPage {}
_ bin .BareEncoder = &UpdateWebPage {}
_ bin .BareDecoder = &UpdateWebPage {}
_ UpdateClass = &UpdateWebPage {}
)
type UpdateReadMessagesContents struct {
Messages []int
Pts int
PtsCount int
}
const UpdateReadMessagesContentsTypeID = 0x68c13933
func (u *UpdateReadMessagesContents ) Zero () bool {
if u == nil {
return true
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateReadMessagesContents ) String () string {
if u == nil {
return "UpdateReadMessagesContents(nil)"
}
type Alias UpdateReadMessagesContents
return fmt .Sprintf ("UpdateReadMessagesContents%+v" , Alias (*u ))
}
func (u *UpdateReadMessagesContents ) FillFrom (from interface {
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateReadMessagesContents ) TypeID () uint32 {
return UpdateReadMessagesContentsTypeID
}
func (*UpdateReadMessagesContents ) TypeName () string {
return "updateReadMessagesContents"
}
func (u *UpdateReadMessagesContents ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadMessagesContents" ,
ID : UpdateReadMessagesContentsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateReadMessagesContents ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadMessagesContents#68c13933 as nil" )
}
b .PutID (UpdateReadMessagesContentsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadMessagesContents ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadMessagesContents#68c13933 as nil" )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateReadMessagesContents ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdateReadMessagesContents ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateReadMessagesContents ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateReadMessagesContents ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadMessagesContents#68c13933 to nil" )
}
if err := b .ConsumeID (UpdateReadMessagesContentsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#68c13933: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadMessagesContents ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadMessagesContents#68c13933 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#68c13933: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#68c13933: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#68c13933: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#68c13933: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateReadMessagesContents ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadMessagesContents {}
_ bin .Decoder = &UpdateReadMessagesContents {}
_ bin .BareEncoder = &UpdateReadMessagesContents {}
_ bin .BareDecoder = &UpdateReadMessagesContents {}
_ UpdateClass = &UpdateReadMessagesContents {}
)
type UpdateChannelTooLong struct {
Flags bin .Fields
ChannelID int
Pts int
}
const UpdateChannelTooLongTypeID = 0xeb0467fb
func (u *UpdateChannelTooLong ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
return true
}
func (u *UpdateChannelTooLong ) String () string {
if u == nil {
return "UpdateChannelTooLong(nil)"
}
type Alias UpdateChannelTooLong
return fmt .Sprintf ("UpdateChannelTooLong%+v" , Alias (*u ))
}
func (u *UpdateChannelTooLong ) FillFrom (from interface {
GetChannelID () (value int )
GetPts () (value int , ok bool )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetPts (); ok {
u .Pts = val
}
}
func (*UpdateChannelTooLong ) TypeID () uint32 {
return UpdateChannelTooLongTypeID
}
func (*UpdateChannelTooLong ) TypeName () string {
return "updateChannelTooLong"
}
func (u *UpdateChannelTooLong ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelTooLong" ,
ID : UpdateChannelTooLongTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateChannelTooLong ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelTooLong#eb0467fb as nil" )
}
b .PutID (UpdateChannelTooLongTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelTooLong ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelTooLong#eb0467fb as nil" )
}
if !(u .Pts == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelTooLong#eb0467fb: field flags: %w" , err )
}
b .PutInt (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutInt (u .Pts )
}
return nil
}
func (u *UpdateChannelTooLong ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelTooLong ) SetPts (value int ) {
u .Flags .Set (0 )
u .Pts = value
}
func (u *UpdateChannelTooLong ) GetPts () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Pts , true
}
func (u *UpdateChannelTooLong ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelTooLong#eb0467fb to nil" )
}
if err := b .ConsumeID (UpdateChannelTooLongTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#eb0467fb: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelTooLong ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelTooLong#eb0467fb to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#eb0467fb: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#eb0467fb: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#eb0467fb: field pts: %w" , err )
}
u .Pts = value
}
return nil
}
func (u UpdateChannelTooLong ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelTooLong {}
_ bin .Decoder = &UpdateChannelTooLong {}
_ bin .BareEncoder = &UpdateChannelTooLong {}
_ bin .BareDecoder = &UpdateChannelTooLong {}
_ UpdateClass = &UpdateChannelTooLong {}
)
type UpdateChannel struct {
ChannelID int
}
const UpdateChannelTypeID = 0xb6d45656
func (u *UpdateChannel ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
return true
}
func (u *UpdateChannel ) String () string {
if u == nil {
return "UpdateChannel(nil)"
}
type Alias UpdateChannel
return fmt .Sprintf ("UpdateChannel%+v" , Alias (*u ))
}
func (u *UpdateChannel ) FillFrom (from interface {
GetChannelID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
}
func (*UpdateChannel ) TypeID () uint32 {
return UpdateChannelTypeID
}
func (*UpdateChannel ) TypeName () string {
return "updateChannel"
}
func (u *UpdateChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannel" ,
ID : UpdateChannelTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
}
return typ
}
func (u *UpdateChannel ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannel#b6d45656 as nil" )
}
b .PutID (UpdateChannelTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannel ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannel#b6d45656 as nil" )
}
b .PutInt (u .ChannelID )
return nil
}
func (u *UpdateChannel ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannel ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannel#b6d45656 to nil" )
}
if err := b .ConsumeID (UpdateChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannel#b6d45656: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannel ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannel#b6d45656 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannel#b6d45656: field channel_id: %w" , err )
}
u .ChannelID = value
}
return nil
}
func (u UpdateChannel ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannel {}
_ bin .Decoder = &UpdateChannel {}
_ bin .BareEncoder = &UpdateChannel {}
_ bin .BareDecoder = &UpdateChannel {}
_ UpdateClass = &UpdateChannel {}
)
type UpdateNewChannelMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateNewChannelMessageTypeID = 0x62ba04d9
func (u *UpdateNewChannelMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateNewChannelMessage ) String () string {
if u == nil {
return "UpdateNewChannelMessage(nil)"
}
type Alias UpdateNewChannelMessage
return fmt .Sprintf ("UpdateNewChannelMessage%+v" , Alias (*u ))
}
func (u *UpdateNewChannelMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateNewChannelMessage ) TypeID () uint32 {
return UpdateNewChannelMessageTypeID
}
func (*UpdateNewChannelMessage ) TypeName () string {
return "updateNewChannelMessage"
}
func (u *UpdateNewChannelMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewChannelMessage" ,
ID : UpdateNewChannelMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateNewChannelMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewChannelMessage#62ba04d9 as nil" )
}
b .PutID (UpdateNewChannelMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewChannelMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewChannelMessage#62ba04d9 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewChannelMessage#62ba04d9: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewChannelMessage#62ba04d9: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateNewChannelMessage ) GetMessage () (value MessageClass ) {
return u .Message
}
func (u *UpdateNewChannelMessage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateNewChannelMessage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateNewChannelMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewChannelMessage#62ba04d9 to nil" )
}
if err := b .ConsumeID (UpdateNewChannelMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewChannelMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewChannelMessage#62ba04d9 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateNewChannelMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewChannelMessage {}
_ bin .Decoder = &UpdateNewChannelMessage {}
_ bin .BareEncoder = &UpdateNewChannelMessage {}
_ bin .BareDecoder = &UpdateNewChannelMessage {}
_ UpdateClass = &UpdateNewChannelMessage {}
)
type UpdateReadChannelInbox struct {
Flags bin .Fields
FolderID int
ChannelID int
MaxID int
StillUnreadCount int
Pts int
}
const UpdateReadChannelInboxTypeID = 0x330b5424
func (u *UpdateReadChannelInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .StillUnreadCount == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelInbox ) String () string {
if u == nil {
return "UpdateReadChannelInbox(nil)"
}
type Alias UpdateReadChannelInbox
return fmt .Sprintf ("UpdateReadChannelInbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelInbox ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetChannelID () (value int )
GetMaxID () (value int )
GetStillUnreadCount () (value int )
GetPts () (value int )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .ChannelID = from .GetChannelID ()
u .MaxID = from .GetMaxID ()
u .StillUnreadCount = from .GetStillUnreadCount ()
u .Pts = from .GetPts ()
}
func (*UpdateReadChannelInbox ) TypeID () uint32 {
return UpdateReadChannelInboxTypeID
}
func (*UpdateReadChannelInbox ) TypeName () string {
return "updateReadChannelInbox"
}
func (u *UpdateReadChannelInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelInbox" ,
ID : UpdateReadChannelInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "StillUnreadCount" ,
SchemaName : "still_unread_count" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
}
return typ
}
func (u *UpdateReadChannelInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelInbox#330b5424 as nil" )
}
b .PutID (UpdateReadChannelInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelInbox#330b5424 as nil" )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadChannelInbox#330b5424: field flags: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .FolderID )
}
b .PutInt (u .ChannelID )
b .PutInt (u .MaxID )
b .PutInt (u .StillUnreadCount )
b .PutInt (u .Pts )
return nil
}
func (u *UpdateReadChannelInbox ) SetFolderID (value int ) {
u .Flags .Set (0 )
u .FolderID = value
}
func (u *UpdateReadChannelInbox ) GetFolderID () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateReadChannelInbox ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateReadChannelInbox ) GetMaxID () (value int ) {
return u .MaxID
}
func (u *UpdateReadChannelInbox ) GetStillUnreadCount () (value int ) {
return u .StillUnreadCount
}
func (u *UpdateReadChannelInbox ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateReadChannelInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelInbox#330b5424 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelInbox#330b5424 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field flags: %w" , err )
}
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field still_unread_count: %w" , err )
}
u .StillUnreadCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#330b5424: field pts: %w" , err )
}
u .Pts = value
}
return nil
}
func (u UpdateReadChannelInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelInbox {}
_ bin .Decoder = &UpdateReadChannelInbox {}
_ bin .BareEncoder = &UpdateReadChannelInbox {}
_ bin .BareDecoder = &UpdateReadChannelInbox {}
_ UpdateClass = &UpdateReadChannelInbox {}
)
type UpdateDeleteChannelMessages struct {
ChannelID int
Messages []int
Pts int
PtsCount int
}
const UpdateDeleteChannelMessagesTypeID = 0xc37521c9
func (u *UpdateDeleteChannelMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateDeleteChannelMessages ) String () string {
if u == nil {
return "UpdateDeleteChannelMessages(nil)"
}
type Alias UpdateDeleteChannelMessages
return fmt .Sprintf ("UpdateDeleteChannelMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteChannelMessages ) FillFrom (from interface {
GetChannelID () (value int )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateDeleteChannelMessages ) TypeID () uint32 {
return UpdateDeleteChannelMessagesTypeID
}
func (*UpdateDeleteChannelMessages ) TypeName () string {
return "updateDeleteChannelMessages"
}
func (u *UpdateDeleteChannelMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteChannelMessages" ,
ID : UpdateDeleteChannelMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateDeleteChannelMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteChannelMessages#c37521c9 as nil" )
}
b .PutID (UpdateDeleteChannelMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteChannelMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteChannelMessages#c37521c9 as nil" )
}
b .PutInt (u .ChannelID )
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateDeleteChannelMessages ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateDeleteChannelMessages ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdateDeleteChannelMessages ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateDeleteChannelMessages ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateDeleteChannelMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteChannelMessages#c37521c9 to nil" )
}
if err := b .ConsumeID (UpdateDeleteChannelMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteChannelMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteChannelMessages#c37521c9 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c37521c9: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateDeleteChannelMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteChannelMessages {}
_ bin .Decoder = &UpdateDeleteChannelMessages {}
_ bin .BareEncoder = &UpdateDeleteChannelMessages {}
_ bin .BareDecoder = &UpdateDeleteChannelMessages {}
_ UpdateClass = &UpdateDeleteChannelMessages {}
)
type UpdateChannelMessageViews struct {
ChannelID int
ID int
Views int
}
const UpdateChannelMessageViewsTypeID = 0x98a12b4b
func (u *UpdateChannelMessageViews ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Views == 0 ) {
return false
}
return true
}
func (u *UpdateChannelMessageViews ) String () string {
if u == nil {
return "UpdateChannelMessageViews(nil)"
}
type Alias UpdateChannelMessageViews
return fmt .Sprintf ("UpdateChannelMessageViews%+v" , Alias (*u ))
}
func (u *UpdateChannelMessageViews ) FillFrom (from interface {
GetChannelID () (value int )
GetID () (value int )
GetViews () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .ID = from .GetID ()
u .Views = from .GetViews ()
}
func (*UpdateChannelMessageViews ) TypeID () uint32 {
return UpdateChannelMessageViewsTypeID
}
func (*UpdateChannelMessageViews ) TypeName () string {
return "updateChannelMessageViews"
}
func (u *UpdateChannelMessageViews ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelMessageViews" ,
ID : UpdateChannelMessageViewsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Views" ,
SchemaName : "views" ,
},
}
return typ
}
func (u *UpdateChannelMessageViews ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageViews#98a12b4b as nil" )
}
b .PutID (UpdateChannelMessageViewsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelMessageViews ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageViews#98a12b4b as nil" )
}
b .PutInt (u .ChannelID )
b .PutInt (u .ID )
b .PutInt (u .Views )
return nil
}
func (u *UpdateChannelMessageViews ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelMessageViews ) GetID () (value int ) {
return u .ID
}
func (u *UpdateChannelMessageViews ) GetViews () (value int ) {
return u .Views
}
func (u *UpdateChannelMessageViews ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageViews#98a12b4b to nil" )
}
if err := b .ConsumeID (UpdateChannelMessageViewsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#98a12b4b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelMessageViews ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageViews#98a12b4b to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#98a12b4b: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#98a12b4b: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#98a12b4b: field views: %w" , err )
}
u .Views = value
}
return nil
}
func (u UpdateChannelMessageViews ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelMessageViews {}
_ bin .Decoder = &UpdateChannelMessageViews {}
_ bin .BareEncoder = &UpdateChannelMessageViews {}
_ bin .BareDecoder = &UpdateChannelMessageViews {}
_ UpdateClass = &UpdateChannelMessageViews {}
)
type UpdateChatParticipantAdmin struct {
ChatID int
UserID int
IsAdmin bool
Version int
}
const UpdateChatParticipantAdminTypeID = 0xb6901959
func (u *UpdateChatParticipantAdmin ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .IsAdmin == false ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantAdmin ) String () string {
if u == nil {
return "UpdateChatParticipantAdmin(nil)"
}
type Alias UpdateChatParticipantAdmin
return fmt .Sprintf ("UpdateChatParticipantAdmin%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantAdmin ) FillFrom (from interface {
GetChatID () (value int )
GetUserID () (value int )
GetIsAdmin () (value bool )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .IsAdmin = from .GetIsAdmin ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantAdmin ) TypeID () uint32 {
return UpdateChatParticipantAdminTypeID
}
func (*UpdateChatParticipantAdmin ) TypeName () string {
return "updateChatParticipantAdmin"
}
func (u *UpdateChatParticipantAdmin ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantAdmin" ,
ID : UpdateChatParticipantAdminTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "IsAdmin" ,
SchemaName : "is_admin" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantAdmin ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdmin#b6901959 as nil" )
}
b .PutID (UpdateChatParticipantAdminTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantAdmin ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdmin#b6901959 as nil" )
}
b .PutInt (u .ChatID )
b .PutInt (u .UserID )
b .PutBool (u .IsAdmin )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantAdmin ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChatParticipantAdmin ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateChatParticipantAdmin ) GetIsAdmin () (value bool ) {
return u .IsAdmin
}
func (u *UpdateChatParticipantAdmin ) GetVersion () (value int ) {
return u .Version
}
func (u *UpdateChatParticipantAdmin ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdmin#b6901959 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantAdminTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#b6901959: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantAdmin ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdmin#b6901959 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#b6901959: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#b6901959: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#b6901959: field is_admin: %w" , err )
}
u .IsAdmin = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#b6901959: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u UpdateChatParticipantAdmin ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantAdmin {}
_ bin .Decoder = &UpdateChatParticipantAdmin {}
_ bin .BareEncoder = &UpdateChatParticipantAdmin {}
_ bin .BareDecoder = &UpdateChatParticipantAdmin {}
_ UpdateClass = &UpdateChatParticipantAdmin {}
)
type UpdateNewStickerSet struct {
Stickerset MessagesStickerSet
}
const UpdateNewStickerSetTypeID = 0x688a30aa
func (u *UpdateNewStickerSet ) Zero () bool {
if u == nil {
return true
}
if !(u .Stickerset .Zero ()) {
return false
}
return true
}
func (u *UpdateNewStickerSet ) String () string {
if u == nil {
return "UpdateNewStickerSet(nil)"
}
type Alias UpdateNewStickerSet
return fmt .Sprintf ("UpdateNewStickerSet%+v" , Alias (*u ))
}
func (u *UpdateNewStickerSet ) FillFrom (from interface {
GetStickerset () (value MessagesStickerSet )
}) {
u .Stickerset = from .GetStickerset ()
}
func (*UpdateNewStickerSet ) TypeID () uint32 {
return UpdateNewStickerSetTypeID
}
func (*UpdateNewStickerSet ) TypeName () string {
return "updateNewStickerSet"
}
func (u *UpdateNewStickerSet ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewStickerSet" ,
ID : UpdateNewStickerSetTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
}
return typ
}
func (u *UpdateNewStickerSet ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewStickerSet#688a30aa as nil" )
}
b .PutID (UpdateNewStickerSetTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewStickerSet ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewStickerSet#688a30aa as nil" )
}
if err := u .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewStickerSet#688a30aa: field stickerset: %w" , err )
}
return nil
}
func (u *UpdateNewStickerSet ) GetStickerset () (value MessagesStickerSet ) {
return u .Stickerset
}
func (u *UpdateNewStickerSet ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewStickerSet#688a30aa to nil" )
}
if err := b .ConsumeID (UpdateNewStickerSetTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewStickerSet#688a30aa: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewStickerSet ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewStickerSet#688a30aa to nil" )
}
{
if err := u .Stickerset .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateNewStickerSet#688a30aa: field stickerset: %w" , err )
}
}
return nil
}
func (u UpdateNewStickerSet ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewStickerSet {}
_ bin .Decoder = &UpdateNewStickerSet {}
_ bin .BareEncoder = &UpdateNewStickerSet {}
_ bin .BareDecoder = &UpdateNewStickerSet {}
_ UpdateClass = &UpdateNewStickerSet {}
)
type UpdateStickerSetsOrder struct {
Flags bin .Fields
Masks bool
Order []int64
}
const UpdateStickerSetsOrderTypeID = 0xbb2d201
func (u *UpdateStickerSetsOrder ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Masks == false ) {
return false
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdateStickerSetsOrder ) String () string {
if u == nil {
return "UpdateStickerSetsOrder(nil)"
}
type Alias UpdateStickerSetsOrder
return fmt .Sprintf ("UpdateStickerSetsOrder%+v" , Alias (*u ))
}
func (u *UpdateStickerSetsOrder ) FillFrom (from interface {
GetMasks () (value bool )
GetOrder () (value []int64 )
}) {
u .Masks = from .GetMasks ()
u .Order = from .GetOrder ()
}
func (*UpdateStickerSetsOrder ) TypeID () uint32 {
return UpdateStickerSetsOrderTypeID
}
func (*UpdateStickerSetsOrder ) TypeName () string {
return "updateStickerSetsOrder"
}
func (u *UpdateStickerSetsOrder ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStickerSetsOrder" ,
ID : UpdateStickerSetsOrderTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Masks" ,
SchemaName : "masks" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Order" ,
SchemaName : "order" ,
},
}
return typ
}
func (u *UpdateStickerSetsOrder ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSetsOrder#bb2d201 as nil" )
}
b .PutID (UpdateStickerSetsOrderTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStickerSetsOrder ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSetsOrder#bb2d201 as nil" )
}
if !(u .Masks == false ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStickerSetsOrder#bb2d201: field flags: %w" , err )
}
b .PutVectorHeader (len (u .Order ))
for _ , v := range u .Order {
b .PutLong (v )
}
return nil
}
func (u *UpdateStickerSetsOrder ) SetMasks (value bool ) {
if value {
u .Flags .Set (0 )
u .Masks = true
} else {
u .Flags .Unset (0 )
u .Masks = false
}
}
func (u *UpdateStickerSetsOrder ) GetMasks () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdateStickerSetsOrder ) GetOrder () (value []int64 ) {
return u .Order
}
func (u *UpdateStickerSetsOrder ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSetsOrder#bb2d201 to nil" )
}
if err := b .ConsumeID (UpdateStickerSetsOrderTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStickerSetsOrder ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSetsOrder#bb2d201 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field flags: %w" , err )
}
}
u .Masks = u .Flags .Has (0 )
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field order: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u UpdateStickerSetsOrder ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStickerSetsOrder {}
_ bin .Decoder = &UpdateStickerSetsOrder {}
_ bin .BareEncoder = &UpdateStickerSetsOrder {}
_ bin .BareDecoder = &UpdateStickerSetsOrder {}
_ UpdateClass = &UpdateStickerSetsOrder {}
)
type UpdateStickerSets struct {
}
const UpdateStickerSetsTypeID = 0x43ae3dec
func (u *UpdateStickerSets ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateStickerSets ) String () string {
if u == nil {
return "UpdateStickerSets(nil)"
}
type Alias UpdateStickerSets
return fmt .Sprintf ("UpdateStickerSets%+v" , Alias (*u ))
}
func (*UpdateStickerSets ) TypeID () uint32 {
return UpdateStickerSetsTypeID
}
func (*UpdateStickerSets ) TypeName () string {
return "updateStickerSets"
}
func (u *UpdateStickerSets ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStickerSets" ,
ID : UpdateStickerSetsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateStickerSets ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSets#43ae3dec as nil" )
}
b .PutID (UpdateStickerSetsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStickerSets ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSets#43ae3dec as nil" )
}
return nil
}
func (u *UpdateStickerSets ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSets#43ae3dec to nil" )
}
if err := b .ConsumeID (UpdateStickerSetsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSets#43ae3dec: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStickerSets ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSets#43ae3dec to nil" )
}
return nil
}
func (u UpdateStickerSets ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStickerSets {}
_ bin .Decoder = &UpdateStickerSets {}
_ bin .BareEncoder = &UpdateStickerSets {}
_ bin .BareDecoder = &UpdateStickerSets {}
_ UpdateClass = &UpdateStickerSets {}
)
type UpdateSavedGifs struct {
}
const UpdateSavedGifsTypeID = 0x9375341e
func (u *UpdateSavedGifs ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateSavedGifs ) String () string {
if u == nil {
return "UpdateSavedGifs(nil)"
}
type Alias UpdateSavedGifs
return fmt .Sprintf ("UpdateSavedGifs%+v" , Alias (*u ))
}
func (*UpdateSavedGifs ) TypeID () uint32 {
return UpdateSavedGifsTypeID
}
func (*UpdateSavedGifs ) TypeName () string {
return "updateSavedGifs"
}
func (u *UpdateSavedGifs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateSavedGifs" ,
ID : UpdateSavedGifsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateSavedGifs ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedGifs#9375341e as nil" )
}
b .PutID (UpdateSavedGifsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateSavedGifs ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedGifs#9375341e as nil" )
}
return nil
}
func (u *UpdateSavedGifs ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedGifs#9375341e to nil" )
}
if err := b .ConsumeID (UpdateSavedGifsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateSavedGifs#9375341e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateSavedGifs ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedGifs#9375341e to nil" )
}
return nil
}
func (u UpdateSavedGifs ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateSavedGifs {}
_ bin .Decoder = &UpdateSavedGifs {}
_ bin .BareEncoder = &UpdateSavedGifs {}
_ bin .BareDecoder = &UpdateSavedGifs {}
_ UpdateClass = &UpdateSavedGifs {}
)
type UpdateBotInlineQuery struct {
Flags bin .Fields
QueryID int64
UserID int
Query string
Geo GeoPointClass
PeerType InlineQueryPeerTypeClass
Offset string
}
const UpdateBotInlineQueryTypeID = 0x3f2038db
func (u *UpdateBotInlineQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Query == "" ) {
return false
}
if !(u .Geo == nil ) {
return false
}
if !(u .PeerType == nil ) {
return false
}
if !(u .Offset == "" ) {
return false
}
return true
}
func (u *UpdateBotInlineQuery ) String () string {
if u == nil {
return "UpdateBotInlineQuery(nil)"
}
type Alias UpdateBotInlineQuery
return fmt .Sprintf ("UpdateBotInlineQuery%+v" , Alias (*u ))
}
func (u *UpdateBotInlineQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int )
GetQuery () (value string )
GetGeo () (value GeoPointClass , ok bool )
GetPeerType () (value InlineQueryPeerTypeClass , ok bool )
GetOffset () (value string )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Query = from .GetQuery ()
if val , ok := from .GetGeo (); ok {
u .Geo = val
}
if val , ok := from .GetPeerType (); ok {
u .PeerType = val
}
u .Offset = from .GetOffset ()
}
func (*UpdateBotInlineQuery ) TypeID () uint32 {
return UpdateBotInlineQueryTypeID
}
func (*UpdateBotInlineQuery ) TypeName () string {
return "updateBotInlineQuery"
}
func (u *UpdateBotInlineQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotInlineQuery" ,
ID : UpdateBotInlineQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
{
Name : "Geo" ,
SchemaName : "geo" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "PeerType" ,
SchemaName : "peer_type" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Offset" ,
SchemaName : "offset" ,
},
}
return typ
}
func (u *UpdateBotInlineQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineQuery#3f2038db as nil" )
}
b .PutID (UpdateBotInlineQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotInlineQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineQuery#3f2038db as nil" )
}
if !(u .Geo == nil ) {
u .Flags .Set (0 )
}
if !(u .PeerType == nil ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#3f2038db: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutInt (u .UserID )
b .PutString (u .Query )
if u .Flags .Has (0 ) {
if u .Geo == nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#3f2038db: field geo is nil" )
}
if err := u .Geo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#3f2038db: field geo: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .PeerType == nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#3f2038db: field peer_type is nil" )
}
if err := u .PeerType .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#3f2038db: field peer_type: %w" , err )
}
}
b .PutString (u .Offset )
return nil
}
func (u *UpdateBotInlineQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateBotInlineQuery ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotInlineQuery ) GetQuery () (value string ) {
return u .Query
}
func (u *UpdateBotInlineQuery ) SetGeo (value GeoPointClass ) {
u .Flags .Set (0 )
u .Geo = value
}
func (u *UpdateBotInlineQuery ) GetGeo () (value GeoPointClass , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Geo , true
}
func (u *UpdateBotInlineQuery ) SetPeerType (value InlineQueryPeerTypeClass ) {
u .Flags .Set (1 )
u .PeerType = value
}
func (u *UpdateBotInlineQuery ) GetPeerType () (value InlineQueryPeerTypeClass , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .PeerType , true
}
func (u *UpdateBotInlineQuery ) GetOffset () (value string ) {
return u .Offset
}
func (u *UpdateBotInlineQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineQuery#3f2038db to nil" )
}
if err := b .ConsumeID (UpdateBotInlineQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotInlineQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineQuery#3f2038db to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field query: %w" , err )
}
u .Query = value
}
if u .Flags .Has (0 ) {
value , err := DecodeGeoPoint (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field geo: %w" , err )
}
u .Geo = value
}
if u .Flags .Has (1 ) {
value , err := DecodeInlineQueryPeerType (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field peer_type: %w" , err )
}
u .PeerType = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#3f2038db: field offset: %w" , err )
}
u .Offset = value
}
return nil
}
func (u UpdateBotInlineQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotInlineQuery {}
_ bin .Decoder = &UpdateBotInlineQuery {}
_ bin .BareEncoder = &UpdateBotInlineQuery {}
_ bin .BareDecoder = &UpdateBotInlineQuery {}
_ UpdateClass = &UpdateBotInlineQuery {}
)
type UpdateBotInlineSend struct {
Flags bin .Fields
UserID int
Query string
Geo GeoPointClass
ID string
MsgID InputBotInlineMessageID
}
const UpdateBotInlineSendTypeID = 0xe48f964
func (u *UpdateBotInlineSend ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Query == "" ) {
return false
}
if !(u .Geo == nil ) {
return false
}
if !(u .ID == "" ) {
return false
}
if !(u .MsgID .Zero ()) {
return false
}
return true
}
func (u *UpdateBotInlineSend ) String () string {
if u == nil {
return "UpdateBotInlineSend(nil)"
}
type Alias UpdateBotInlineSend
return fmt .Sprintf ("UpdateBotInlineSend%+v" , Alias (*u ))
}
func (u *UpdateBotInlineSend ) FillFrom (from interface {
GetUserID () (value int )
GetQuery () (value string )
GetGeo () (value GeoPointClass , ok bool )
GetID () (value string )
GetMsgID () (value InputBotInlineMessageID , ok bool )
}) {
u .UserID = from .GetUserID ()
u .Query = from .GetQuery ()
if val , ok := from .GetGeo (); ok {
u .Geo = val
}
u .ID = from .GetID ()
if val , ok := from .GetMsgID (); ok {
u .MsgID = val
}
}
func (*UpdateBotInlineSend ) TypeID () uint32 {
return UpdateBotInlineSendTypeID
}
func (*UpdateBotInlineSend ) TypeName () string {
return "updateBotInlineSend"
}
func (u *UpdateBotInlineSend ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotInlineSend" ,
ID : UpdateBotInlineSendTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
{
Name : "Geo" ,
SchemaName : "geo" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateBotInlineSend ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineSend#e48f964 as nil" )
}
b .PutID (UpdateBotInlineSendTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotInlineSend ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineSend#e48f964 as nil" )
}
if !(u .Geo == nil ) {
u .Flags .Set (0 )
}
if !(u .MsgID .Zero ()) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#e48f964: field flags: %w" , err )
}
b .PutInt (u .UserID )
b .PutString (u .Query )
if u .Flags .Has (0 ) {
if u .Geo == nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#e48f964: field geo is nil" )
}
if err := u .Geo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#e48f964: field geo: %w" , err )
}
}
b .PutString (u .ID )
if u .Flags .Has (1 ) {
if err := u .MsgID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#e48f964: field msg_id: %w" , err )
}
}
return nil
}
func (u *UpdateBotInlineSend ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotInlineSend ) GetQuery () (value string ) {
return u .Query
}
func (u *UpdateBotInlineSend ) SetGeo (value GeoPointClass ) {
u .Flags .Set (0 )
u .Geo = value
}
func (u *UpdateBotInlineSend ) GetGeo () (value GeoPointClass , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Geo , true
}
func (u *UpdateBotInlineSend ) GetID () (value string ) {
return u .ID
}
func (u *UpdateBotInlineSend ) SetMsgID (value InputBotInlineMessageID ) {
u .Flags .Set (1 )
u .MsgID = value
}
func (u *UpdateBotInlineSend ) GetMsgID () (value InputBotInlineMessageID , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .MsgID , true
}
func (u *UpdateBotInlineSend ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineSend#e48f964 to nil" )
}
if err := b .ConsumeID (UpdateBotInlineSendTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotInlineSend ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineSend#e48f964 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field query: %w" , err )
}
u .Query = value
}
if u .Flags .Has (0 ) {
value , err := DecodeGeoPoint (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field geo: %w" , err )
}
u .Geo = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field id: %w" , err )
}
u .ID = value
}
if u .Flags .Has (1 ) {
if err := u .MsgID .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#e48f964: field msg_id: %w" , err )
}
}
return nil
}
func (u UpdateBotInlineSend ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotInlineSend {}
_ bin .Decoder = &UpdateBotInlineSend {}
_ bin .BareEncoder = &UpdateBotInlineSend {}
_ bin .BareDecoder = &UpdateBotInlineSend {}
_ UpdateClass = &UpdateBotInlineSend {}
)
type UpdateEditChannelMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateEditChannelMessageTypeID = 0x1b3f4df7
func (u *UpdateEditChannelMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateEditChannelMessage ) String () string {
if u == nil {
return "UpdateEditChannelMessage(nil)"
}
type Alias UpdateEditChannelMessage
return fmt .Sprintf ("UpdateEditChannelMessage%+v" , Alias (*u ))
}
func (u *UpdateEditChannelMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateEditChannelMessage ) TypeID () uint32 {
return UpdateEditChannelMessageTypeID
}
func (*UpdateEditChannelMessage ) TypeName () string {
return "updateEditChannelMessage"
}
func (u *UpdateEditChannelMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEditChannelMessage" ,
ID : UpdateEditChannelMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateEditChannelMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditChannelMessage#1b3f4df7 as nil" )
}
b .PutID (UpdateEditChannelMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEditChannelMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditChannelMessage#1b3f4df7 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateEditChannelMessage#1b3f4df7: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEditChannelMessage#1b3f4df7: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateEditChannelMessage ) GetMessage () (value MessageClass ) {
return u .Message
}
func (u *UpdateEditChannelMessage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateEditChannelMessage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateEditChannelMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditChannelMessage#1b3f4df7 to nil" )
}
if err := b .ConsumeID (UpdateEditChannelMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEditChannelMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditChannelMessage#1b3f4df7 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateEditChannelMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEditChannelMessage {}
_ bin .Decoder = &UpdateEditChannelMessage {}
_ bin .BareEncoder = &UpdateEditChannelMessage {}
_ bin .BareDecoder = &UpdateEditChannelMessage {}
_ UpdateClass = &UpdateEditChannelMessage {}
)
type UpdateBotCallbackQuery struct {
Flags bin .Fields
QueryID int64
UserID int
Peer PeerClass
MsgID int
ChatInstance int64
Data []byte
GameShortName string
}
const UpdateBotCallbackQueryTypeID = 0xe73547e1
func (u *UpdateBotCallbackQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .ChatInstance == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
if !(u .GameShortName == "" ) {
return false
}
return true
}
func (u *UpdateBotCallbackQuery ) String () string {
if u == nil {
return "UpdateBotCallbackQuery(nil)"
}
type Alias UpdateBotCallbackQuery
return fmt .Sprintf ("UpdateBotCallbackQuery%+v" , Alias (*u ))
}
func (u *UpdateBotCallbackQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int )
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetChatInstance () (value int64 )
GetData () (value []byte , ok bool )
GetGameShortName () (value string , ok bool )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .ChatInstance = from .GetChatInstance ()
if val , ok := from .GetData (); ok {
u .Data = val
}
if val , ok := from .GetGameShortName (); ok {
u .GameShortName = val
}
}
func (*UpdateBotCallbackQuery ) TypeID () uint32 {
return UpdateBotCallbackQueryTypeID
}
func (*UpdateBotCallbackQuery ) TypeName () string {
return "updateBotCallbackQuery"
}
func (u *UpdateBotCallbackQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotCallbackQuery" ,
ID : UpdateBotCallbackQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ChatInstance" ,
SchemaName : "chat_instance" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "GameShortName" ,
SchemaName : "game_short_name" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateBotCallbackQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCallbackQuery#e73547e1 as nil" )
}
b .PutID (UpdateBotCallbackQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotCallbackQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCallbackQuery#e73547e1 as nil" )
}
if !(u .Data == nil ) {
u .Flags .Set (0 )
}
if !(u .GameShortName == "" ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#e73547e1: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutInt (u .UserID )
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#e73547e1: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#e73547e1: field peer: %w" , err )
}
b .PutInt (u .MsgID )
b .PutLong (u .ChatInstance )
if u .Flags .Has (0 ) {
b .PutBytes (u .Data )
}
if u .Flags .Has (1 ) {
b .PutString (u .GameShortName )
}
return nil
}
func (u *UpdateBotCallbackQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateBotCallbackQuery ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotCallbackQuery ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateBotCallbackQuery ) GetMsgID () (value int ) {
return u .MsgID
}
func (u *UpdateBotCallbackQuery ) GetChatInstance () (value int64 ) {
return u .ChatInstance
}
func (u *UpdateBotCallbackQuery ) SetData (value []byte ) {
u .Flags .Set (0 )
u .Data = value
}
func (u *UpdateBotCallbackQuery ) GetData () (value []byte , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Data , true
}
func (u *UpdateBotCallbackQuery ) SetGameShortName (value string ) {
u .Flags .Set (1 )
u .GameShortName = value
}
func (u *UpdateBotCallbackQuery ) GetGameShortName () (value string , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .GameShortName , true
}
func (u *UpdateBotCallbackQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCallbackQuery#e73547e1 to nil" )
}
if err := b .ConsumeID (UpdateBotCallbackQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotCallbackQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCallbackQuery#e73547e1 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field chat_instance: %w" , err )
}
u .ChatInstance = value
}
if u .Flags .Has (0 ) {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field data: %w" , err )
}
u .Data = value
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#e73547e1: field game_short_name: %w" , err )
}
u .GameShortName = value
}
return nil
}
func (u UpdateBotCallbackQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotCallbackQuery {}
_ bin .Decoder = &UpdateBotCallbackQuery {}
_ bin .BareEncoder = &UpdateBotCallbackQuery {}
_ bin .BareDecoder = &UpdateBotCallbackQuery {}
_ UpdateClass = &UpdateBotCallbackQuery {}
)
type UpdateEditMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateEditMessageTypeID = 0xe40370a3
func (u *UpdateEditMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateEditMessage ) String () string {
if u == nil {
return "UpdateEditMessage(nil)"
}
type Alias UpdateEditMessage
return fmt .Sprintf ("UpdateEditMessage%+v" , Alias (*u ))
}
func (u *UpdateEditMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateEditMessage ) TypeID () uint32 {
return UpdateEditMessageTypeID
}
func (*UpdateEditMessage ) TypeName () string {
return "updateEditMessage"
}
func (u *UpdateEditMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEditMessage" ,
ID : UpdateEditMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateEditMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditMessage#e40370a3 as nil" )
}
b .PutID (UpdateEditMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEditMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditMessage#e40370a3 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateEditMessage#e40370a3: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEditMessage#e40370a3: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateEditMessage ) GetMessage () (value MessageClass ) {
return u .Message
}
func (u *UpdateEditMessage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateEditMessage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateEditMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditMessage#e40370a3 to nil" )
}
if err := b .ConsumeID (UpdateEditMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEditMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditMessage#e40370a3 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateEditMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEditMessage {}
_ bin .Decoder = &UpdateEditMessage {}
_ bin .BareEncoder = &UpdateEditMessage {}
_ bin .BareDecoder = &UpdateEditMessage {}
_ UpdateClass = &UpdateEditMessage {}
)
type UpdateInlineBotCallbackQuery struct {
Flags bin .Fields
QueryID int64
UserID int
MsgID InputBotInlineMessageID
ChatInstance int64
Data []byte
GameShortName string
}
const UpdateInlineBotCallbackQueryTypeID = 0xf9d27a5a
func (u *UpdateInlineBotCallbackQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .MsgID .Zero ()) {
return false
}
if !(u .ChatInstance == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
if !(u .GameShortName == "" ) {
return false
}
return true
}
func (u *UpdateInlineBotCallbackQuery ) String () string {
if u == nil {
return "UpdateInlineBotCallbackQuery(nil)"
}
type Alias UpdateInlineBotCallbackQuery
return fmt .Sprintf ("UpdateInlineBotCallbackQuery%+v" , Alias (*u ))
}
func (u *UpdateInlineBotCallbackQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int )
GetMsgID () (value InputBotInlineMessageID )
GetChatInstance () (value int64 )
GetData () (value []byte , ok bool )
GetGameShortName () (value string , ok bool )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .MsgID = from .GetMsgID ()
u .ChatInstance = from .GetChatInstance ()
if val , ok := from .GetData (); ok {
u .Data = val
}
if val , ok := from .GetGameShortName (); ok {
u .GameShortName = val
}
}
func (*UpdateInlineBotCallbackQuery ) TypeID () uint32 {
return UpdateInlineBotCallbackQueryTypeID
}
func (*UpdateInlineBotCallbackQuery ) TypeName () string {
return "updateInlineBotCallbackQuery"
}
func (u *UpdateInlineBotCallbackQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateInlineBotCallbackQuery" ,
ID : UpdateInlineBotCallbackQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ChatInstance" ,
SchemaName : "chat_instance" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "GameShortName" ,
SchemaName : "game_short_name" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateInlineBotCallbackQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateInlineBotCallbackQuery#f9d27a5a as nil" )
}
b .PutID (UpdateInlineBotCallbackQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateInlineBotCallbackQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateInlineBotCallbackQuery#f9d27a5a as nil" )
}
if !(u .Data == nil ) {
u .Flags .Set (0 )
}
if !(u .GameShortName == "" ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateInlineBotCallbackQuery#f9d27a5a: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutInt (u .UserID )
if err := u .MsgID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateInlineBotCallbackQuery#f9d27a5a: field msg_id: %w" , err )
}
b .PutLong (u .ChatInstance )
if u .Flags .Has (0 ) {
b .PutBytes (u .Data )
}
if u .Flags .Has (1 ) {
b .PutString (u .GameShortName )
}
return nil
}
func (u *UpdateInlineBotCallbackQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateInlineBotCallbackQuery ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateInlineBotCallbackQuery ) GetMsgID () (value InputBotInlineMessageID ) {
return u .MsgID
}
func (u *UpdateInlineBotCallbackQuery ) GetChatInstance () (value int64 ) {
return u .ChatInstance
}
func (u *UpdateInlineBotCallbackQuery ) SetData (value []byte ) {
u .Flags .Set (0 )
u .Data = value
}
func (u *UpdateInlineBotCallbackQuery ) GetData () (value []byte , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Data , true
}
func (u *UpdateInlineBotCallbackQuery ) SetGameShortName (value string ) {
u .Flags .Set (1 )
u .GameShortName = value
}
func (u *UpdateInlineBotCallbackQuery ) GetGameShortName () (value string , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .GameShortName , true
}
func (u *UpdateInlineBotCallbackQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateInlineBotCallbackQuery#f9d27a5a to nil" )
}
if err := b .ConsumeID (UpdateInlineBotCallbackQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateInlineBotCallbackQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateInlineBotCallbackQuery#f9d27a5a to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field user_id: %w" , err )
}
u .UserID = value
}
{
if err := u .MsgID .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field msg_id: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field chat_instance: %w" , err )
}
u .ChatInstance = value
}
if u .Flags .Has (0 ) {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field data: %w" , err )
}
u .Data = value
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field game_short_name: %w" , err )
}
u .GameShortName = value
}
return nil
}
func (u UpdateInlineBotCallbackQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateInlineBotCallbackQuery {}
_ bin .Decoder = &UpdateInlineBotCallbackQuery {}
_ bin .BareEncoder = &UpdateInlineBotCallbackQuery {}
_ bin .BareDecoder = &UpdateInlineBotCallbackQuery {}
_ UpdateClass = &UpdateInlineBotCallbackQuery {}
)
type UpdateReadChannelOutbox struct {
ChannelID int
MaxID int
}
const UpdateReadChannelOutboxTypeID = 0x25d6c9c7
func (u *UpdateReadChannelOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelOutbox ) String () string {
if u == nil {
return "UpdateReadChannelOutbox(nil)"
}
type Alias UpdateReadChannelOutbox
return fmt .Sprintf ("UpdateReadChannelOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelOutbox ) FillFrom (from interface {
GetChannelID () (value int )
GetMaxID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .MaxID = from .GetMaxID ()
}
func (*UpdateReadChannelOutbox ) TypeID () uint32 {
return UpdateReadChannelOutboxTypeID
}
func (*UpdateReadChannelOutbox ) TypeName () string {
return "updateReadChannelOutbox"
}
func (u *UpdateReadChannelOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelOutbox" ,
ID : UpdateReadChannelOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
}
return typ
}
func (u *UpdateReadChannelOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelOutbox#25d6c9c7 as nil" )
}
b .PutID (UpdateReadChannelOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelOutbox#25d6c9c7 as nil" )
}
b .PutInt (u .ChannelID )
b .PutInt (u .MaxID )
return nil
}
func (u *UpdateReadChannelOutbox ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateReadChannelOutbox ) GetMaxID () (value int ) {
return u .MaxID
}
func (u *UpdateReadChannelOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelOutbox#25d6c9c7 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#25d6c9c7: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelOutbox#25d6c9c7 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#25d6c9c7: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#25d6c9c7: field max_id: %w" , err )
}
u .MaxID = value
}
return nil
}
func (u UpdateReadChannelOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelOutbox {}
_ bin .Decoder = &UpdateReadChannelOutbox {}
_ bin .BareEncoder = &UpdateReadChannelOutbox {}
_ bin .BareDecoder = &UpdateReadChannelOutbox {}
_ UpdateClass = &UpdateReadChannelOutbox {}
)
type UpdateDraftMessage struct {
Peer PeerClass
Draft DraftMessageClass
}
const UpdateDraftMessageTypeID = 0xee2bb969
func (u *UpdateDraftMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Draft == nil ) {
return false
}
return true
}
func (u *UpdateDraftMessage ) String () string {
if u == nil {
return "UpdateDraftMessage(nil)"
}
type Alias UpdateDraftMessage
return fmt .Sprintf ("UpdateDraftMessage%+v" , Alias (*u ))
}
func (u *UpdateDraftMessage ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetDraft () (value DraftMessageClass )
}) {
u .Peer = from .GetPeer ()
u .Draft = from .GetDraft ()
}
func (*UpdateDraftMessage ) TypeID () uint32 {
return UpdateDraftMessageTypeID
}
func (*UpdateDraftMessage ) TypeName () string {
return "updateDraftMessage"
}
func (u *UpdateDraftMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDraftMessage" ,
ID : UpdateDraftMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Draft" ,
SchemaName : "draft" ,
},
}
return typ
}
func (u *UpdateDraftMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDraftMessage#ee2bb969 as nil" )
}
b .PutID (UpdateDraftMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDraftMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDraftMessage#ee2bb969 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDraftMessage#ee2bb969: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDraftMessage#ee2bb969: field peer: %w" , err )
}
if u .Draft == nil {
return fmt .Errorf ("unable to encode updateDraftMessage#ee2bb969: field draft is nil" )
}
if err := u .Draft .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDraftMessage#ee2bb969: field draft: %w" , err )
}
return nil
}
func (u *UpdateDraftMessage ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateDraftMessage ) GetDraft () (value DraftMessageClass ) {
return u .Draft
}
func (u *UpdateDraftMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDraftMessage#ee2bb969 to nil" )
}
if err := b .ConsumeID (UpdateDraftMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#ee2bb969: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDraftMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDraftMessage#ee2bb969 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#ee2bb969: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := DecodeDraftMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#ee2bb969: field draft: %w" , err )
}
u .Draft = value
}
return nil
}
func (u UpdateDraftMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDraftMessage {}
_ bin .Decoder = &UpdateDraftMessage {}
_ bin .BareEncoder = &UpdateDraftMessage {}
_ bin .BareDecoder = &UpdateDraftMessage {}
_ UpdateClass = &UpdateDraftMessage {}
)
type UpdateReadFeaturedStickers struct {
}
const UpdateReadFeaturedStickersTypeID = 0x571d2742
func (u *UpdateReadFeaturedStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateReadFeaturedStickers ) String () string {
if u == nil {
return "UpdateReadFeaturedStickers(nil)"
}
type Alias UpdateReadFeaturedStickers
return fmt .Sprintf ("UpdateReadFeaturedStickers%+v" , Alias (*u ))
}
func (*UpdateReadFeaturedStickers ) TypeID () uint32 {
return UpdateReadFeaturedStickersTypeID
}
func (*UpdateReadFeaturedStickers ) TypeName () string {
return "updateReadFeaturedStickers"
}
func (u *UpdateReadFeaturedStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadFeaturedStickers" ,
ID : UpdateReadFeaturedStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateReadFeaturedStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedStickers#571d2742 as nil" )
}
b .PutID (UpdateReadFeaturedStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadFeaturedStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedStickers#571d2742 as nil" )
}
return nil
}
func (u *UpdateReadFeaturedStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedStickers#571d2742 to nil" )
}
if err := b .ConsumeID (UpdateReadFeaturedStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadFeaturedStickers#571d2742: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadFeaturedStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedStickers#571d2742 to nil" )
}
return nil
}
func (u UpdateReadFeaturedStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadFeaturedStickers {}
_ bin .Decoder = &UpdateReadFeaturedStickers {}
_ bin .BareEncoder = &UpdateReadFeaturedStickers {}
_ bin .BareDecoder = &UpdateReadFeaturedStickers {}
_ UpdateClass = &UpdateReadFeaturedStickers {}
)
type UpdateRecentStickers struct {
}
const UpdateRecentStickersTypeID = 0x9a422c20
func (u *UpdateRecentStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateRecentStickers ) String () string {
if u == nil {
return "UpdateRecentStickers(nil)"
}
type Alias UpdateRecentStickers
return fmt .Sprintf ("UpdateRecentStickers%+v" , Alias (*u ))
}
func (*UpdateRecentStickers ) TypeID () uint32 {
return UpdateRecentStickersTypeID
}
func (*UpdateRecentStickers ) TypeName () string {
return "updateRecentStickers"
}
func (u *UpdateRecentStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateRecentStickers" ,
ID : UpdateRecentStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateRecentStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentStickers#9a422c20 as nil" )
}
b .PutID (UpdateRecentStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateRecentStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentStickers#9a422c20 as nil" )
}
return nil
}
func (u *UpdateRecentStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentStickers#9a422c20 to nil" )
}
if err := b .ConsumeID (UpdateRecentStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateRecentStickers#9a422c20: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateRecentStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentStickers#9a422c20 to nil" )
}
return nil
}
func (u UpdateRecentStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateRecentStickers {}
_ bin .Decoder = &UpdateRecentStickers {}
_ bin .BareEncoder = &UpdateRecentStickers {}
_ bin .BareDecoder = &UpdateRecentStickers {}
_ UpdateClass = &UpdateRecentStickers {}
)
type UpdateConfig struct {
}
const UpdateConfigTypeID = 0xa229dd06
func (u *UpdateConfig ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateConfig ) String () string {
if u == nil {
return "UpdateConfig(nil)"
}
type Alias UpdateConfig
return fmt .Sprintf ("UpdateConfig%+v" , Alias (*u ))
}
func (*UpdateConfig ) TypeID () uint32 {
return UpdateConfigTypeID
}
func (*UpdateConfig ) TypeName () string {
return "updateConfig"
}
func (u *UpdateConfig ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateConfig" ,
ID : UpdateConfigTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateConfig ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateConfig#a229dd06 as nil" )
}
b .PutID (UpdateConfigTypeID )
return u .EncodeBare (b )
}
func (u *UpdateConfig ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateConfig#a229dd06 as nil" )
}
return nil
}
func (u *UpdateConfig ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateConfig#a229dd06 to nil" )
}
if err := b .ConsumeID (UpdateConfigTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateConfig#a229dd06: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateConfig ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateConfig#a229dd06 to nil" )
}
return nil
}
func (u UpdateConfig ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateConfig {}
_ bin .Decoder = &UpdateConfig {}
_ bin .BareEncoder = &UpdateConfig {}
_ bin .BareDecoder = &UpdateConfig {}
_ UpdateClass = &UpdateConfig {}
)
type UpdatePtsChanged struct {
}
const UpdatePtsChangedTypeID = 0x3354678f
func (u *UpdatePtsChanged ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdatePtsChanged ) String () string {
if u == nil {
return "UpdatePtsChanged(nil)"
}
type Alias UpdatePtsChanged
return fmt .Sprintf ("UpdatePtsChanged%+v" , Alias (*u ))
}
func (*UpdatePtsChanged ) TypeID () uint32 {
return UpdatePtsChangedTypeID
}
func (*UpdatePtsChanged ) TypeName () string {
return "updatePtsChanged"
}
func (u *UpdatePtsChanged ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePtsChanged" ,
ID : UpdatePtsChangedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdatePtsChanged ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePtsChanged#3354678f as nil" )
}
b .PutID (UpdatePtsChangedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePtsChanged ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePtsChanged#3354678f as nil" )
}
return nil
}
func (u *UpdatePtsChanged ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePtsChanged#3354678f to nil" )
}
if err := b .ConsumeID (UpdatePtsChangedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePtsChanged#3354678f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePtsChanged ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePtsChanged#3354678f to nil" )
}
return nil
}
func (u UpdatePtsChanged ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePtsChanged {}
_ bin .Decoder = &UpdatePtsChanged {}
_ bin .BareEncoder = &UpdatePtsChanged {}
_ bin .BareDecoder = &UpdatePtsChanged {}
_ UpdateClass = &UpdatePtsChanged {}
)
type UpdateChannelWebPage struct {
ChannelID int
Webpage WebPageClass
Pts int
PtsCount int
}
const UpdateChannelWebPageTypeID = 0x40771900
func (u *UpdateChannelWebPage ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Webpage == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateChannelWebPage ) String () string {
if u == nil {
return "UpdateChannelWebPage(nil)"
}
type Alias UpdateChannelWebPage
return fmt .Sprintf ("UpdateChannelWebPage%+v" , Alias (*u ))
}
func (u *UpdateChannelWebPage ) FillFrom (from interface {
GetChannelID () (value int )
GetWebpage () (value WebPageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .Webpage = from .GetWebpage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateChannelWebPage ) TypeID () uint32 {
return UpdateChannelWebPageTypeID
}
func (*UpdateChannelWebPage ) TypeName () string {
return "updateChannelWebPage"
}
func (u *UpdateChannelWebPage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelWebPage" ,
ID : UpdateChannelWebPageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Webpage" ,
SchemaName : "webpage" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateChannelWebPage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelWebPage#40771900 as nil" )
}
b .PutID (UpdateChannelWebPageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelWebPage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelWebPage#40771900 as nil" )
}
b .PutInt (u .ChannelID )
if u .Webpage == nil {
return fmt .Errorf ("unable to encode updateChannelWebPage#40771900: field webpage is nil" )
}
if err := u .Webpage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelWebPage#40771900: field webpage: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateChannelWebPage ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelWebPage ) GetWebpage () (value WebPageClass ) {
return u .Webpage
}
func (u *UpdateChannelWebPage ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateChannelWebPage ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateChannelWebPage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelWebPage#40771900 to nil" )
}
if err := b .ConsumeID (UpdateChannelWebPageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#40771900: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelWebPage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelWebPage#40771900 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#40771900: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := DecodeWebPage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#40771900: field webpage: %w" , err )
}
u .Webpage = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#40771900: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#40771900: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateChannelWebPage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelWebPage {}
_ bin .Decoder = &UpdateChannelWebPage {}
_ bin .BareEncoder = &UpdateChannelWebPage {}
_ bin .BareDecoder = &UpdateChannelWebPage {}
_ UpdateClass = &UpdateChannelWebPage {}
)
type UpdateDialogPinned struct {
Flags bin .Fields
Pinned bool
FolderID int
Peer DialogPeerClass
}
const UpdateDialogPinnedTypeID = 0x6e6fe51c
func (u *UpdateDialogPinned ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
return true
}
func (u *UpdateDialogPinned ) String () string {
if u == nil {
return "UpdateDialogPinned(nil)"
}
type Alias UpdateDialogPinned
return fmt .Sprintf ("UpdateDialogPinned%+v" , Alias (*u ))
}
func (u *UpdateDialogPinned ) FillFrom (from interface {
GetPinned () (value bool )
GetFolderID () (value int , ok bool )
GetPeer () (value DialogPeerClass )
}) {
u .Pinned = from .GetPinned ()
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .Peer = from .GetPeer ()
}
func (*UpdateDialogPinned ) TypeID () uint32 {
return UpdateDialogPinnedTypeID
}
func (*UpdateDialogPinned ) TypeName () string {
return "updateDialogPinned"
}
func (u *UpdateDialogPinned ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogPinned" ,
ID : UpdateDialogPinnedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (u *UpdateDialogPinned ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogPinned#6e6fe51c as nil" )
}
b .PutID (UpdateDialogPinnedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogPinned ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogPinned#6e6fe51c as nil" )
}
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .FolderID )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field peer: %w" , err )
}
return nil
}
func (u *UpdateDialogPinned ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdateDialogPinned ) GetPinned () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdateDialogPinned ) SetFolderID (value int ) {
u .Flags .Set (1 )
u .FolderID = value
}
func (u *UpdateDialogPinned ) GetFolderID () (value int , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateDialogPinned ) GetPeer () (value DialogPeerClass ) {
return u .Peer
}
func (u *UpdateDialogPinned ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogPinned#6e6fe51c to nil" )
}
if err := b .ConsumeID (UpdateDialogPinnedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogPinned ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogPinned#6e6fe51c to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field peer: %w" , err )
}
u .Peer = value
}
return nil
}
func (u UpdateDialogPinned ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogPinned {}
_ bin .Decoder = &UpdateDialogPinned {}
_ bin .BareEncoder = &UpdateDialogPinned {}
_ bin .BareDecoder = &UpdateDialogPinned {}
_ UpdateClass = &UpdateDialogPinned {}
)
type UpdatePinnedDialogs struct {
Flags bin .Fields
FolderID int
Order []DialogPeerClass
}
const UpdatePinnedDialogsTypeID = 0xfa0f3ca2
func (u *UpdatePinnedDialogs ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdatePinnedDialogs ) String () string {
if u == nil {
return "UpdatePinnedDialogs(nil)"
}
type Alias UpdatePinnedDialogs
return fmt .Sprintf ("UpdatePinnedDialogs%+v" , Alias (*u ))
}
func (u *UpdatePinnedDialogs ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetOrder () (value []DialogPeerClass , ok bool )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
if val , ok := from .GetOrder (); ok {
u .Order = val
}
}
func (*UpdatePinnedDialogs ) TypeID () uint32 {
return UpdatePinnedDialogsTypeID
}
func (*UpdatePinnedDialogs ) TypeName () string {
return "updatePinnedDialogs"
}
func (u *UpdatePinnedDialogs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedDialogs" ,
ID : UpdatePinnedDialogsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Order" ,
SchemaName : "order" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdatePinnedDialogs ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedDialogs#fa0f3ca2 as nil" )
}
b .PutID (UpdatePinnedDialogsTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedDialogs ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedDialogs#fa0f3ca2 as nil" )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (1 )
}
if !(u .Order == nil ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .FolderID )
}
if u .Flags .Has (0 ) {
b .PutVectorHeader (len (u .Order ))
for idx , v := range u .Order {
if v == nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d: %w" , idx , err )
}
}
}
return nil
}
func (u *UpdatePinnedDialogs ) SetFolderID (value int ) {
u .Flags .Set (1 )
u .FolderID = value
}
func (u *UpdatePinnedDialogs ) GetFolderID () (value int , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdatePinnedDialogs ) SetOrder (value []DialogPeerClass ) {
u .Flags .Set (0 )
u .Order = value
}
func (u *UpdatePinnedDialogs ) GetOrder () (value []DialogPeerClass , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Order , true
}
func (u *UpdatePinnedDialogs ) MapOrder () (value DialogPeerClassArray , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return DialogPeerClassArray (u .Order ), true
}
func (u *UpdatePinnedDialogs ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedDialogs#fa0f3ca2 to nil" )
}
if err := b .ConsumeID (UpdatePinnedDialogsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedDialogs ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedDialogs#fa0f3ca2 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field flags: %w" , err )
}
}
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field folder_id: %w" , err )
}
u .FolderID = value
}
if u .Flags .Has (0 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u UpdatePinnedDialogs ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedDialogs {}
_ bin .Decoder = &UpdatePinnedDialogs {}
_ bin .BareEncoder = &UpdatePinnedDialogs {}
_ bin .BareDecoder = &UpdatePinnedDialogs {}
_ UpdateClass = &UpdatePinnedDialogs {}
)
type UpdateBotWebhookJSON struct {
Data DataJSON
}
const UpdateBotWebhookJSONTypeID = 0x8317c0c3
func (u *UpdateBotWebhookJSON ) Zero () bool {
if u == nil {
return true
}
if !(u .Data .Zero ()) {
return false
}
return true
}
func (u *UpdateBotWebhookJSON ) String () string {
if u == nil {
return "UpdateBotWebhookJSON(nil)"
}
type Alias UpdateBotWebhookJSON
return fmt .Sprintf ("UpdateBotWebhookJSON%+v" , Alias (*u ))
}
func (u *UpdateBotWebhookJSON ) FillFrom (from interface {
GetData () (value DataJSON )
}) {
u .Data = from .GetData ()
}
func (*UpdateBotWebhookJSON ) TypeID () uint32 {
return UpdateBotWebhookJSONTypeID
}
func (*UpdateBotWebhookJSON ) TypeName () string {
return "updateBotWebhookJSON"
}
func (u *UpdateBotWebhookJSON ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotWebhookJSON" ,
ID : UpdateBotWebhookJSONTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Data" ,
SchemaName : "data" ,
},
}
return typ
}
func (u *UpdateBotWebhookJSON ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSON#8317c0c3 as nil" )
}
b .PutID (UpdateBotWebhookJSONTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotWebhookJSON ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSON#8317c0c3 as nil" )
}
if err := u .Data .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotWebhookJSON#8317c0c3: field data: %w" , err )
}
return nil
}
func (u *UpdateBotWebhookJSON ) GetData () (value DataJSON ) {
return u .Data
}
func (u *UpdateBotWebhookJSON ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSON#8317c0c3 to nil" )
}
if err := b .ConsumeID (UpdateBotWebhookJSONTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSON#8317c0c3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotWebhookJSON ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSON#8317c0c3 to nil" )
}
{
if err := u .Data .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSON#8317c0c3: field data: %w" , err )
}
}
return nil
}
func (u UpdateBotWebhookJSON ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotWebhookJSON {}
_ bin .Decoder = &UpdateBotWebhookJSON {}
_ bin .BareEncoder = &UpdateBotWebhookJSON {}
_ bin .BareDecoder = &UpdateBotWebhookJSON {}
_ UpdateClass = &UpdateBotWebhookJSON {}
)
type UpdateBotWebhookJSONQuery struct {
QueryID int64
Data DataJSON
Timeout int
}
const UpdateBotWebhookJSONQueryTypeID = 0x9b9240a6
func (u *UpdateBotWebhookJSONQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .Data .Zero ()) {
return false
}
if !(u .Timeout == 0 ) {
return false
}
return true
}
func (u *UpdateBotWebhookJSONQuery ) String () string {
if u == nil {
return "UpdateBotWebhookJSONQuery(nil)"
}
type Alias UpdateBotWebhookJSONQuery
return fmt .Sprintf ("UpdateBotWebhookJSONQuery%+v" , Alias (*u ))
}
func (u *UpdateBotWebhookJSONQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetData () (value DataJSON )
GetTimeout () (value int )
}) {
u .QueryID = from .GetQueryID ()
u .Data = from .GetData ()
u .Timeout = from .GetTimeout ()
}
func (*UpdateBotWebhookJSONQuery ) TypeID () uint32 {
return UpdateBotWebhookJSONQueryTypeID
}
func (*UpdateBotWebhookJSONQuery ) TypeName () string {
return "updateBotWebhookJSONQuery"
}
func (u *UpdateBotWebhookJSONQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotWebhookJSONQuery" ,
ID : UpdateBotWebhookJSONQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
},
{
Name : "Timeout" ,
SchemaName : "timeout" ,
},
}
return typ
}
func (u *UpdateBotWebhookJSONQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil" )
}
b .PutID (UpdateBotWebhookJSONQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotWebhookJSONQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil" )
}
b .PutLong (u .QueryID )
if err := u .Data .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotWebhookJSONQuery#9b9240a6: field data: %w" , err )
}
b .PutInt (u .Timeout )
return nil
}
func (u *UpdateBotWebhookJSONQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateBotWebhookJSONQuery ) GetData () (value DataJSON ) {
return u .Data
}
func (u *UpdateBotWebhookJSONQuery ) GetTimeout () (value int ) {
return u .Timeout
}
func (u *UpdateBotWebhookJSONQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSONQuery#9b9240a6 to nil" )
}
if err := b .ConsumeID (UpdateBotWebhookJSONQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotWebhookJSONQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSONQuery#9b9240a6 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field query_id: %w" , err )
}
u .QueryID = value
}
{
if err := u .Data .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field data: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field timeout: %w" , err )
}
u .Timeout = value
}
return nil
}
func (u UpdateBotWebhookJSONQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotWebhookJSONQuery {}
_ bin .Decoder = &UpdateBotWebhookJSONQuery {}
_ bin .BareEncoder = &UpdateBotWebhookJSONQuery {}
_ bin .BareDecoder = &UpdateBotWebhookJSONQuery {}
_ UpdateClass = &UpdateBotWebhookJSONQuery {}
)
type UpdateBotShippingQuery struct {
QueryID int64
UserID int
Payload []byte
ShippingAddress PostAddress
}
const UpdateBotShippingQueryTypeID = 0xe0cdc940
func (u *UpdateBotShippingQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Payload == nil ) {
return false
}
if !(u .ShippingAddress .Zero ()) {
return false
}
return true
}
func (u *UpdateBotShippingQuery ) String () string {
if u == nil {
return "UpdateBotShippingQuery(nil)"
}
type Alias UpdateBotShippingQuery
return fmt .Sprintf ("UpdateBotShippingQuery%+v" , Alias (*u ))
}
func (u *UpdateBotShippingQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int )
GetPayload () (value []byte )
GetShippingAddress () (value PostAddress )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Payload = from .GetPayload ()
u .ShippingAddress = from .GetShippingAddress ()
}
func (*UpdateBotShippingQuery ) TypeID () uint32 {
return UpdateBotShippingQueryTypeID
}
func (*UpdateBotShippingQuery ) TypeName () string {
return "updateBotShippingQuery"
}
func (u *UpdateBotShippingQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotShippingQuery" ,
ID : UpdateBotShippingQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Payload" ,
SchemaName : "payload" ,
},
{
Name : "ShippingAddress" ,
SchemaName : "shipping_address" ,
},
}
return typ
}
func (u *UpdateBotShippingQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotShippingQuery#e0cdc940 as nil" )
}
b .PutID (UpdateBotShippingQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotShippingQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotShippingQuery#e0cdc940 as nil" )
}
b .PutLong (u .QueryID )
b .PutInt (u .UserID )
b .PutBytes (u .Payload )
if err := u .ShippingAddress .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotShippingQuery#e0cdc940: field shipping_address: %w" , err )
}
return nil
}
func (u *UpdateBotShippingQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateBotShippingQuery ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotShippingQuery ) GetPayload () (value []byte ) {
return u .Payload
}
func (u *UpdateBotShippingQuery ) GetShippingAddress () (value PostAddress ) {
return u .ShippingAddress
}
func (u *UpdateBotShippingQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotShippingQuery#e0cdc940 to nil" )
}
if err := b .ConsumeID (UpdateBotShippingQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#e0cdc940: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotShippingQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotShippingQuery#e0cdc940 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#e0cdc940: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#e0cdc940: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#e0cdc940: field payload: %w" , err )
}
u .Payload = value
}
{
if err := u .ShippingAddress .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#e0cdc940: field shipping_address: %w" , err )
}
}
return nil
}
func (u UpdateBotShippingQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotShippingQuery {}
_ bin .Decoder = &UpdateBotShippingQuery {}
_ bin .BareEncoder = &UpdateBotShippingQuery {}
_ bin .BareDecoder = &UpdateBotShippingQuery {}
_ UpdateClass = &UpdateBotShippingQuery {}
)
type UpdateBotPrecheckoutQuery struct {
Flags bin .Fields
QueryID int64
UserID int
Payload []byte
Info PaymentRequestedInfo
ShippingOptionID string
Currency string
TotalAmount int64
}
const UpdateBotPrecheckoutQueryTypeID = 0x5d2f3aa9
func (u *UpdateBotPrecheckoutQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Payload == nil ) {
return false
}
if !(u .Info .Zero ()) {
return false
}
if !(u .ShippingOptionID == "" ) {
return false
}
if !(u .Currency == "" ) {
return false
}
if !(u .TotalAmount == 0 ) {
return false
}
return true
}
func (u *UpdateBotPrecheckoutQuery ) String () string {
if u == nil {
return "UpdateBotPrecheckoutQuery(nil)"
}
type Alias UpdateBotPrecheckoutQuery
return fmt .Sprintf ("UpdateBotPrecheckoutQuery%+v" , Alias (*u ))
}
func (u *UpdateBotPrecheckoutQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int )
GetPayload () (value []byte )
GetInfo () (value PaymentRequestedInfo , ok bool )
GetShippingOptionID () (value string , ok bool )
GetCurrency () (value string )
GetTotalAmount () (value int64 )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Payload = from .GetPayload ()
if val , ok := from .GetInfo (); ok {
u .Info = val
}
if val , ok := from .GetShippingOptionID (); ok {
u .ShippingOptionID = val
}
u .Currency = from .GetCurrency ()
u .TotalAmount = from .GetTotalAmount ()
}
func (*UpdateBotPrecheckoutQuery ) TypeID () uint32 {
return UpdateBotPrecheckoutQueryTypeID
}
func (*UpdateBotPrecheckoutQuery ) TypeName () string {
return "updateBotPrecheckoutQuery"
}
func (u *UpdateBotPrecheckoutQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotPrecheckoutQuery" ,
ID : UpdateBotPrecheckoutQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Payload" ,
SchemaName : "payload" ,
},
{
Name : "Info" ,
SchemaName : "info" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ShippingOptionID" ,
SchemaName : "shipping_option_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Currency" ,
SchemaName : "currency" ,
},
{
Name : "TotalAmount" ,
SchemaName : "total_amount" ,
},
}
return typ
}
func (u *UpdateBotPrecheckoutQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotPrecheckoutQuery#5d2f3aa9 as nil" )
}
b .PutID (UpdateBotPrecheckoutQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotPrecheckoutQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotPrecheckoutQuery#5d2f3aa9 as nil" )
}
if !(u .Info .Zero ()) {
u .Flags .Set (0 )
}
if !(u .ShippingOptionID == "" ) {
u .Flags .Set (1 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotPrecheckoutQuery#5d2f3aa9: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutInt (u .UserID )
b .PutBytes (u .Payload )
if u .Flags .Has (0 ) {
if err := u .Info .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotPrecheckoutQuery#5d2f3aa9: field info: %w" , err )
}
}
if u .Flags .Has (1 ) {
b .PutString (u .ShippingOptionID )
}
b .PutString (u .Currency )
b .PutLong (u .TotalAmount )
return nil
}
func (u *UpdateBotPrecheckoutQuery ) GetQueryID () (value int64 ) {
return u .QueryID
}
func (u *UpdateBotPrecheckoutQuery ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotPrecheckoutQuery ) GetPayload () (value []byte ) {
return u .Payload
}
func (u *UpdateBotPrecheckoutQuery ) SetInfo (value PaymentRequestedInfo ) {
u .Flags .Set (0 )
u .Info = value
}
func (u *UpdateBotPrecheckoutQuery ) GetInfo () (value PaymentRequestedInfo , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Info , true
}
func (u *UpdateBotPrecheckoutQuery ) SetShippingOptionID (value string ) {
u .Flags .Set (1 )
u .ShippingOptionID = value
}
func (u *UpdateBotPrecheckoutQuery ) GetShippingOptionID () (value string , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .ShippingOptionID , true
}
func (u *UpdateBotPrecheckoutQuery ) GetCurrency () (value string ) {
return u .Currency
}
func (u *UpdateBotPrecheckoutQuery ) GetTotalAmount () (value int64 ) {
return u .TotalAmount
}
func (u *UpdateBotPrecheckoutQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotPrecheckoutQuery#5d2f3aa9 to nil" )
}
if err := b .ConsumeID (UpdateBotPrecheckoutQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotPrecheckoutQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotPrecheckoutQuery#5d2f3aa9 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field payload: %w" , err )
}
u .Payload = value
}
if u .Flags .Has (0 ) {
if err := u .Info .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field info: %w" , err )
}
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field shipping_option_id: %w" , err )
}
u .ShippingOptionID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field currency: %w" , err )
}
u .Currency = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field total_amount: %w" , err )
}
u .TotalAmount = value
}
return nil
}
func (u UpdateBotPrecheckoutQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotPrecheckoutQuery {}
_ bin .Decoder = &UpdateBotPrecheckoutQuery {}
_ bin .BareEncoder = &UpdateBotPrecheckoutQuery {}
_ bin .BareDecoder = &UpdateBotPrecheckoutQuery {}
_ UpdateClass = &UpdateBotPrecheckoutQuery {}
)
type UpdatePhoneCall struct {
PhoneCall PhoneCallClass
}
const UpdatePhoneCallTypeID = 0xab0f6b1e
func (u *UpdatePhoneCall ) Zero () bool {
if u == nil {
return true
}
if !(u .PhoneCall == nil ) {
return false
}
return true
}
func (u *UpdatePhoneCall ) String () string {
if u == nil {
return "UpdatePhoneCall(nil)"
}
type Alias UpdatePhoneCall
return fmt .Sprintf ("UpdatePhoneCall%+v" , Alias (*u ))
}
func (u *UpdatePhoneCall ) FillFrom (from interface {
GetPhoneCall () (value PhoneCallClass )
}) {
u .PhoneCall = from .GetPhoneCall ()
}
func (*UpdatePhoneCall ) TypeID () uint32 {
return UpdatePhoneCallTypeID
}
func (*UpdatePhoneCall ) TypeName () string {
return "updatePhoneCall"
}
func (u *UpdatePhoneCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePhoneCall" ,
ID : UpdatePhoneCallTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PhoneCall" ,
SchemaName : "phone_call" ,
},
}
return typ
}
func (u *UpdatePhoneCall ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCall#ab0f6b1e as nil" )
}
b .PutID (UpdatePhoneCallTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePhoneCall ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCall#ab0f6b1e as nil" )
}
if u .PhoneCall == nil {
return fmt .Errorf ("unable to encode updatePhoneCall#ab0f6b1e: field phone_call is nil" )
}
if err := u .PhoneCall .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePhoneCall#ab0f6b1e: field phone_call: %w" , err )
}
return nil
}
func (u *UpdatePhoneCall ) GetPhoneCall () (value PhoneCallClass ) {
return u .PhoneCall
}
func (u *UpdatePhoneCall ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCall#ab0f6b1e to nil" )
}
if err := b .ConsumeID (UpdatePhoneCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePhoneCall#ab0f6b1e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePhoneCall ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCall#ab0f6b1e to nil" )
}
{
value , err := DecodePhoneCall (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCall#ab0f6b1e: field phone_call: %w" , err )
}
u .PhoneCall = value
}
return nil
}
func (u UpdatePhoneCall ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePhoneCall {}
_ bin .Decoder = &UpdatePhoneCall {}
_ bin .BareEncoder = &UpdatePhoneCall {}
_ bin .BareDecoder = &UpdatePhoneCall {}
_ UpdateClass = &UpdatePhoneCall {}
)
type UpdateLangPackTooLong struct {
LangCode string
}
const UpdateLangPackTooLongTypeID = 0x46560264
func (u *UpdateLangPackTooLong ) Zero () bool {
if u == nil {
return true
}
if !(u .LangCode == "" ) {
return false
}
return true
}
func (u *UpdateLangPackTooLong ) String () string {
if u == nil {
return "UpdateLangPackTooLong(nil)"
}
type Alias UpdateLangPackTooLong
return fmt .Sprintf ("UpdateLangPackTooLong%+v" , Alias (*u ))
}
func (u *UpdateLangPackTooLong ) FillFrom (from interface {
GetLangCode () (value string )
}) {
u .LangCode = from .GetLangCode ()
}
func (*UpdateLangPackTooLong ) TypeID () uint32 {
return UpdateLangPackTooLongTypeID
}
func (*UpdateLangPackTooLong ) TypeName () string {
return "updateLangPackTooLong"
}
func (u *UpdateLangPackTooLong ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLangPackTooLong" ,
ID : UpdateLangPackTooLongTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "LangCode" ,
SchemaName : "lang_code" ,
},
}
return typ
}
func (u *UpdateLangPackTooLong ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPackTooLong#46560264 as nil" )
}
b .PutID (UpdateLangPackTooLongTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLangPackTooLong ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPackTooLong#46560264 as nil" )
}
b .PutString (u .LangCode )
return nil
}
func (u *UpdateLangPackTooLong ) GetLangCode () (value string ) {
return u .LangCode
}
func (u *UpdateLangPackTooLong ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPackTooLong#46560264 to nil" )
}
if err := b .ConsumeID (UpdateLangPackTooLongTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLangPackTooLong#46560264: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLangPackTooLong ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPackTooLong#46560264 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateLangPackTooLong#46560264: field lang_code: %w" , err )
}
u .LangCode = value
}
return nil
}
func (u UpdateLangPackTooLong ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLangPackTooLong {}
_ bin .Decoder = &UpdateLangPackTooLong {}
_ bin .BareEncoder = &UpdateLangPackTooLong {}
_ bin .BareDecoder = &UpdateLangPackTooLong {}
_ UpdateClass = &UpdateLangPackTooLong {}
)
type UpdateLangPack struct {
Difference LangPackDifference
}
const UpdateLangPackTypeID = 0x56022f4d
func (u *UpdateLangPack ) Zero () bool {
if u == nil {
return true
}
if !(u .Difference .Zero ()) {
return false
}
return true
}
func (u *UpdateLangPack ) String () string {
if u == nil {
return "UpdateLangPack(nil)"
}
type Alias UpdateLangPack
return fmt .Sprintf ("UpdateLangPack%+v" , Alias (*u ))
}
func (u *UpdateLangPack ) FillFrom (from interface {
GetDifference () (value LangPackDifference )
}) {
u .Difference = from .GetDifference ()
}
func (*UpdateLangPack ) TypeID () uint32 {
return UpdateLangPackTypeID
}
func (*UpdateLangPack ) TypeName () string {
return "updateLangPack"
}
func (u *UpdateLangPack ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLangPack" ,
ID : UpdateLangPackTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Difference" ,
SchemaName : "difference" ,
},
}
return typ
}
func (u *UpdateLangPack ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPack#56022f4d as nil" )
}
b .PutID (UpdateLangPackTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLangPack ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPack#56022f4d as nil" )
}
if err := u .Difference .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateLangPack#56022f4d: field difference: %w" , err )
}
return nil
}
func (u *UpdateLangPack ) GetDifference () (value LangPackDifference ) {
return u .Difference
}
func (u *UpdateLangPack ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPack#56022f4d to nil" )
}
if err := b .ConsumeID (UpdateLangPackTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLangPack#56022f4d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLangPack ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPack#56022f4d to nil" )
}
{
if err := u .Difference .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateLangPack#56022f4d: field difference: %w" , err )
}
}
return nil
}
func (u UpdateLangPack ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLangPack {}
_ bin .Decoder = &UpdateLangPack {}
_ bin .BareEncoder = &UpdateLangPack {}
_ bin .BareDecoder = &UpdateLangPack {}
_ UpdateClass = &UpdateLangPack {}
)
type UpdateFavedStickers struct {
}
const UpdateFavedStickersTypeID = 0xe511996d
func (u *UpdateFavedStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateFavedStickers ) String () string {
if u == nil {
return "UpdateFavedStickers(nil)"
}
type Alias UpdateFavedStickers
return fmt .Sprintf ("UpdateFavedStickers%+v" , Alias (*u ))
}
func (*UpdateFavedStickers ) TypeID () uint32 {
return UpdateFavedStickersTypeID
}
func (*UpdateFavedStickers ) TypeName () string {
return "updateFavedStickers"
}
func (u *UpdateFavedStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateFavedStickers" ,
ID : UpdateFavedStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateFavedStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFavedStickers#e511996d as nil" )
}
b .PutID (UpdateFavedStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateFavedStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFavedStickers#e511996d as nil" )
}
return nil
}
func (u *UpdateFavedStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFavedStickers#e511996d to nil" )
}
if err := b .ConsumeID (UpdateFavedStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateFavedStickers#e511996d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateFavedStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFavedStickers#e511996d to nil" )
}
return nil
}
func (u UpdateFavedStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateFavedStickers {}
_ bin .Decoder = &UpdateFavedStickers {}
_ bin .BareEncoder = &UpdateFavedStickers {}
_ bin .BareDecoder = &UpdateFavedStickers {}
_ UpdateClass = &UpdateFavedStickers {}
)
type UpdateChannelReadMessagesContents struct {
ChannelID int
Messages []int
}
const UpdateChannelReadMessagesContentsTypeID = 0x89893b45
func (u *UpdateChannelReadMessagesContents ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
return true
}
func (u *UpdateChannelReadMessagesContents ) String () string {
if u == nil {
return "UpdateChannelReadMessagesContents(nil)"
}
type Alias UpdateChannelReadMessagesContents
return fmt .Sprintf ("UpdateChannelReadMessagesContents%+v" , Alias (*u ))
}
func (u *UpdateChannelReadMessagesContents ) FillFrom (from interface {
GetChannelID () (value int )
GetMessages () (value []int )
}) {
u .ChannelID = from .GetChannelID ()
u .Messages = from .GetMessages ()
}
func (*UpdateChannelReadMessagesContents ) TypeID () uint32 {
return UpdateChannelReadMessagesContentsTypeID
}
func (*UpdateChannelReadMessagesContents ) TypeName () string {
return "updateChannelReadMessagesContents"
}
func (u *UpdateChannelReadMessagesContents ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelReadMessagesContents" ,
ID : UpdateChannelReadMessagesContentsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
}
return typ
}
func (u *UpdateChannelReadMessagesContents ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelReadMessagesContents#89893b45 as nil" )
}
b .PutID (UpdateChannelReadMessagesContentsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelReadMessagesContents ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelReadMessagesContents#89893b45 as nil" )
}
b .PutInt (u .ChannelID )
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
return nil
}
func (u *UpdateChannelReadMessagesContents ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelReadMessagesContents ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdateChannelReadMessagesContents ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelReadMessagesContents#89893b45 to nil" )
}
if err := b .ConsumeID (UpdateChannelReadMessagesContentsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#89893b45: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelReadMessagesContents ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelReadMessagesContents#89893b45 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#89893b45: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#89893b45: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#89893b45: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
return nil
}
func (u UpdateChannelReadMessagesContents ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelReadMessagesContents {}
_ bin .Decoder = &UpdateChannelReadMessagesContents {}
_ bin .BareEncoder = &UpdateChannelReadMessagesContents {}
_ bin .BareDecoder = &UpdateChannelReadMessagesContents {}
_ UpdateClass = &UpdateChannelReadMessagesContents {}
)
type UpdateContactsReset struct {
}
const UpdateContactsResetTypeID = 0x7084a7be
func (u *UpdateContactsReset ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateContactsReset ) String () string {
if u == nil {
return "UpdateContactsReset(nil)"
}
type Alias UpdateContactsReset
return fmt .Sprintf ("UpdateContactsReset%+v" , Alias (*u ))
}
func (*UpdateContactsReset ) TypeID () uint32 {
return UpdateContactsResetTypeID
}
func (*UpdateContactsReset ) TypeName () string {
return "updateContactsReset"
}
func (u *UpdateContactsReset ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateContactsReset" ,
ID : UpdateContactsResetTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateContactsReset ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateContactsReset#7084a7be as nil" )
}
b .PutID (UpdateContactsResetTypeID )
return u .EncodeBare (b )
}
func (u *UpdateContactsReset ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateContactsReset#7084a7be as nil" )
}
return nil
}
func (u *UpdateContactsReset ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateContactsReset#7084a7be to nil" )
}
if err := b .ConsumeID (UpdateContactsResetTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateContactsReset#7084a7be: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateContactsReset ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateContactsReset#7084a7be to nil" )
}
return nil
}
func (u UpdateContactsReset ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateContactsReset {}
_ bin .Decoder = &UpdateContactsReset {}
_ bin .BareEncoder = &UpdateContactsReset {}
_ bin .BareDecoder = &UpdateContactsReset {}
_ UpdateClass = &UpdateContactsReset {}
)
type UpdateChannelAvailableMessages struct {
ChannelID int
AvailableMinID int
}
const UpdateChannelAvailableMessagesTypeID = 0x70db6837
func (u *UpdateChannelAvailableMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .AvailableMinID == 0 ) {
return false
}
return true
}
func (u *UpdateChannelAvailableMessages ) String () string {
if u == nil {
return "UpdateChannelAvailableMessages(nil)"
}
type Alias UpdateChannelAvailableMessages
return fmt .Sprintf ("UpdateChannelAvailableMessages%+v" , Alias (*u ))
}
func (u *UpdateChannelAvailableMessages ) FillFrom (from interface {
GetChannelID () (value int )
GetAvailableMinID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .AvailableMinID = from .GetAvailableMinID ()
}
func (*UpdateChannelAvailableMessages ) TypeID () uint32 {
return UpdateChannelAvailableMessagesTypeID
}
func (*UpdateChannelAvailableMessages ) TypeName () string {
return "updateChannelAvailableMessages"
}
func (u *UpdateChannelAvailableMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelAvailableMessages" ,
ID : UpdateChannelAvailableMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "AvailableMinID" ,
SchemaName : "available_min_id" ,
},
}
return typ
}
func (u *UpdateChannelAvailableMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelAvailableMessages#70db6837 as nil" )
}
b .PutID (UpdateChannelAvailableMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelAvailableMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelAvailableMessages#70db6837 as nil" )
}
b .PutInt (u .ChannelID )
b .PutInt (u .AvailableMinID )
return nil
}
func (u *UpdateChannelAvailableMessages ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelAvailableMessages ) GetAvailableMinID () (value int ) {
return u .AvailableMinID
}
func (u *UpdateChannelAvailableMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelAvailableMessages#70db6837 to nil" )
}
if err := b .ConsumeID (UpdateChannelAvailableMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#70db6837: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelAvailableMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelAvailableMessages#70db6837 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#70db6837: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#70db6837: field available_min_id: %w" , err )
}
u .AvailableMinID = value
}
return nil
}
func (u UpdateChannelAvailableMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelAvailableMessages {}
_ bin .Decoder = &UpdateChannelAvailableMessages {}
_ bin .BareEncoder = &UpdateChannelAvailableMessages {}
_ bin .BareDecoder = &UpdateChannelAvailableMessages {}
_ UpdateClass = &UpdateChannelAvailableMessages {}
)
type UpdateDialogUnreadMark struct {
Flags bin .Fields
Unread bool
Peer DialogPeerClass
}
const UpdateDialogUnreadMarkTypeID = 0xe16459c3
func (u *UpdateDialogUnreadMark ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Unread == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
return true
}
func (u *UpdateDialogUnreadMark ) String () string {
if u == nil {
return "UpdateDialogUnreadMark(nil)"
}
type Alias UpdateDialogUnreadMark
return fmt .Sprintf ("UpdateDialogUnreadMark%+v" , Alias (*u ))
}
func (u *UpdateDialogUnreadMark ) FillFrom (from interface {
GetUnread () (value bool )
GetPeer () (value DialogPeerClass )
}) {
u .Unread = from .GetUnread ()
u .Peer = from .GetPeer ()
}
func (*UpdateDialogUnreadMark ) TypeID () uint32 {
return UpdateDialogUnreadMarkTypeID
}
func (*UpdateDialogUnreadMark ) TypeName () string {
return "updateDialogUnreadMark"
}
func (u *UpdateDialogUnreadMark ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogUnreadMark" ,
ID : UpdateDialogUnreadMarkTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Unread" ,
SchemaName : "unread" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (u *UpdateDialogUnreadMark ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogUnreadMark#e16459c3 as nil" )
}
b .PutID (UpdateDialogUnreadMarkTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogUnreadMark ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogUnreadMark#e16459c3 as nil" )
}
if !(u .Unread == false ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field peer: %w" , err )
}
return nil
}
func (u *UpdateDialogUnreadMark ) SetUnread (value bool ) {
if value {
u .Flags .Set (0 )
u .Unread = true
} else {
u .Flags .Unset (0 )
u .Unread = false
}
}
func (u *UpdateDialogUnreadMark ) GetUnread () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdateDialogUnreadMark ) GetPeer () (value DialogPeerClass ) {
return u .Peer
}
func (u *UpdateDialogUnreadMark ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogUnreadMark#e16459c3 to nil" )
}
if err := b .ConsumeID (UpdateDialogUnreadMarkTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogUnreadMark ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogUnreadMark#e16459c3 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: field flags: %w" , err )
}
}
u .Unread = u .Flags .Has (0 )
{
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: field peer: %w" , err )
}
u .Peer = value
}
return nil
}
func (u UpdateDialogUnreadMark ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogUnreadMark {}
_ bin .Decoder = &UpdateDialogUnreadMark {}
_ bin .BareEncoder = &UpdateDialogUnreadMark {}
_ bin .BareDecoder = &UpdateDialogUnreadMark {}
_ UpdateClass = &UpdateDialogUnreadMark {}
)
type UpdateMessagePoll struct {
Flags bin .Fields
PollID int64
Poll Poll
Results PollResults
}
const UpdateMessagePollTypeID = 0xaca1657b
func (u *UpdateMessagePoll ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .PollID == 0 ) {
return false
}
if !(u .Poll .Zero ()) {
return false
}
if !(u .Results .Zero ()) {
return false
}
return true
}
func (u *UpdateMessagePoll ) String () string {
if u == nil {
return "UpdateMessagePoll(nil)"
}
type Alias UpdateMessagePoll
return fmt .Sprintf ("UpdateMessagePoll%+v" , Alias (*u ))
}
func (u *UpdateMessagePoll ) FillFrom (from interface {
GetPollID () (value int64 )
GetPoll () (value Poll , ok bool )
GetResults () (value PollResults )
}) {
u .PollID = from .GetPollID ()
if val , ok := from .GetPoll (); ok {
u .Poll = val
}
u .Results = from .GetResults ()
}
func (*UpdateMessagePoll ) TypeID () uint32 {
return UpdateMessagePollTypeID
}
func (*UpdateMessagePoll ) TypeName () string {
return "updateMessagePoll"
}
func (u *UpdateMessagePoll ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessagePoll" ,
ID : UpdateMessagePollTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PollID" ,
SchemaName : "poll_id" ,
},
{
Name : "Poll" ,
SchemaName : "poll" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Results" ,
SchemaName : "results" ,
},
}
return typ
}
func (u *UpdateMessagePoll ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePoll#aca1657b as nil" )
}
b .PutID (UpdateMessagePollTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessagePoll ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePoll#aca1657b as nil" )
}
if !(u .Poll .Zero ()) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field flags: %w" , err )
}
b .PutLong (u .PollID )
if u .Flags .Has (0 ) {
if err := u .Poll .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field poll: %w" , err )
}
}
if err := u .Results .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field results: %w" , err )
}
return nil
}
func (u *UpdateMessagePoll ) GetPollID () (value int64 ) {
return u .PollID
}
func (u *UpdateMessagePoll ) SetPoll (value Poll ) {
u .Flags .Set (0 )
u .Poll = value
}
func (u *UpdateMessagePoll ) GetPoll () (value Poll , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Poll , true
}
func (u *UpdateMessagePoll ) GetResults () (value PollResults ) {
return u .Results
}
func (u *UpdateMessagePoll ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePoll#aca1657b to nil" )
}
if err := b .ConsumeID (UpdateMessagePollTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessagePoll ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePoll#aca1657b to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field poll_id: %w" , err )
}
u .PollID = value
}
if u .Flags .Has (0 ) {
if err := u .Poll .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field poll: %w" , err )
}
}
{
if err := u .Results .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field results: %w" , err )
}
}
return nil
}
func (u UpdateMessagePoll ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessagePoll {}
_ bin .Decoder = &UpdateMessagePoll {}
_ bin .BareEncoder = &UpdateMessagePoll {}
_ bin .BareDecoder = &UpdateMessagePoll {}
_ UpdateClass = &UpdateMessagePoll {}
)
type UpdateChatDefaultBannedRights struct {
Peer PeerClass
DefaultBannedRights ChatBannedRights
Version int
}
const UpdateChatDefaultBannedRightsTypeID = 0x54c01850
func (u *UpdateChatDefaultBannedRights ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .DefaultBannedRights .Zero ()) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatDefaultBannedRights ) String () string {
if u == nil {
return "UpdateChatDefaultBannedRights(nil)"
}
type Alias UpdateChatDefaultBannedRights
return fmt .Sprintf ("UpdateChatDefaultBannedRights%+v" , Alias (*u ))
}
func (u *UpdateChatDefaultBannedRights ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetDefaultBannedRights () (value ChatBannedRights )
GetVersion () (value int )
}) {
u .Peer = from .GetPeer ()
u .DefaultBannedRights = from .GetDefaultBannedRights ()
u .Version = from .GetVersion ()
}
func (*UpdateChatDefaultBannedRights ) TypeID () uint32 {
return UpdateChatDefaultBannedRightsTypeID
}
func (*UpdateChatDefaultBannedRights ) TypeName () string {
return "updateChatDefaultBannedRights"
}
func (u *UpdateChatDefaultBannedRights ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatDefaultBannedRights" ,
ID : UpdateChatDefaultBannedRightsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "DefaultBannedRights" ,
SchemaName : "default_banned_rights" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatDefaultBannedRights ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatDefaultBannedRights#54c01850 as nil" )
}
b .PutID (UpdateChatDefaultBannedRightsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatDefaultBannedRights ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatDefaultBannedRights#54c01850 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field peer: %w" , err )
}
if err := u .DefaultBannedRights .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w" , err )
}
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatDefaultBannedRights ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateChatDefaultBannedRights ) GetDefaultBannedRights () (value ChatBannedRights ) {
return u .DefaultBannedRights
}
func (u *UpdateChatDefaultBannedRights ) GetVersion () (value int ) {
return u .Version
}
func (u *UpdateChatDefaultBannedRights ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatDefaultBannedRights#54c01850 to nil" )
}
if err := b .ConsumeID (UpdateChatDefaultBannedRightsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatDefaultBannedRights ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatDefaultBannedRights#54c01850 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .DefaultBannedRights .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u UpdateChatDefaultBannedRights ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatDefaultBannedRights {}
_ bin .Decoder = &UpdateChatDefaultBannedRights {}
_ bin .BareEncoder = &UpdateChatDefaultBannedRights {}
_ bin .BareDecoder = &UpdateChatDefaultBannedRights {}
_ UpdateClass = &UpdateChatDefaultBannedRights {}
)
type UpdateFolderPeers struct {
FolderPeers []FolderPeer
Pts int
PtsCount int
}
const UpdateFolderPeersTypeID = 0x19360dc0
func (u *UpdateFolderPeers ) Zero () bool {
if u == nil {
return true
}
if !(u .FolderPeers == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateFolderPeers ) String () string {
if u == nil {
return "UpdateFolderPeers(nil)"
}
type Alias UpdateFolderPeers
return fmt .Sprintf ("UpdateFolderPeers%+v" , Alias (*u ))
}
func (u *UpdateFolderPeers ) FillFrom (from interface {
GetFolderPeers () (value []FolderPeer )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .FolderPeers = from .GetFolderPeers ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateFolderPeers ) TypeID () uint32 {
return UpdateFolderPeersTypeID
}
func (*UpdateFolderPeers ) TypeName () string {
return "updateFolderPeers"
}
func (u *UpdateFolderPeers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateFolderPeers" ,
ID : UpdateFolderPeersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderPeers" ,
SchemaName : "folder_peers" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateFolderPeers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFolderPeers#19360dc0 as nil" )
}
b .PutID (UpdateFolderPeersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateFolderPeers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFolderPeers#19360dc0 as nil" )
}
b .PutVectorHeader (len (u .FolderPeers ))
for idx , v := range u .FolderPeers {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateFolderPeers#19360dc0: field folder_peers element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateFolderPeers ) GetFolderPeers () (value []FolderPeer ) {
return u .FolderPeers
}
func (u *UpdateFolderPeers ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdateFolderPeers ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdateFolderPeers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFolderPeers#19360dc0 to nil" )
}
if err := b .ConsumeID (UpdateFolderPeersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateFolderPeers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFolderPeers#19360dc0 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value FolderPeer
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w" , err )
}
u .FolderPeers = append (u .FolderPeers , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdateFolderPeers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateFolderPeers {}
_ bin .Decoder = &UpdateFolderPeers {}
_ bin .BareEncoder = &UpdateFolderPeers {}
_ bin .BareDecoder = &UpdateFolderPeers {}
_ UpdateClass = &UpdateFolderPeers {}
)
type UpdatePeerSettings struct {
Peer PeerClass
Settings PeerSettings
}
const UpdatePeerSettingsTypeID = 0x6a7e7366
func (u *UpdatePeerSettings ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Settings .Zero ()) {
return false
}
return true
}
func (u *UpdatePeerSettings ) String () string {
if u == nil {
return "UpdatePeerSettings(nil)"
}
type Alias UpdatePeerSettings
return fmt .Sprintf ("UpdatePeerSettings%+v" , Alias (*u ))
}
func (u *UpdatePeerSettings ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetSettings () (value PeerSettings )
}) {
u .Peer = from .GetPeer ()
u .Settings = from .GetSettings ()
}
func (*UpdatePeerSettings ) TypeID () uint32 {
return UpdatePeerSettingsTypeID
}
func (*UpdatePeerSettings ) TypeName () string {
return "updatePeerSettings"
}
func (u *UpdatePeerSettings ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerSettings" ,
ID : UpdatePeerSettingsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Settings" ,
SchemaName : "settings" ,
},
}
return typ
}
func (u *UpdatePeerSettings ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerSettings#6a7e7366 as nil" )
}
b .PutID (UpdatePeerSettingsTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerSettings ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerSettings#6a7e7366 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field peer: %w" , err )
}
if err := u .Settings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field settings: %w" , err )
}
return nil
}
func (u *UpdatePeerSettings ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdatePeerSettings ) GetSettings () (value PeerSettings ) {
return u .Settings
}
func (u *UpdatePeerSettings ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerSettings#6a7e7366 to nil" )
}
if err := b .ConsumeID (UpdatePeerSettingsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerSettings ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerSettings#6a7e7366 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .Settings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: field settings: %w" , err )
}
}
return nil
}
func (u UpdatePeerSettings ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerSettings {}
_ bin .Decoder = &UpdatePeerSettings {}
_ bin .BareEncoder = &UpdatePeerSettings {}
_ bin .BareDecoder = &UpdatePeerSettings {}
_ UpdateClass = &UpdatePeerSettings {}
)
type UpdatePeerLocated struct {
Peers []PeerLocatedClass
}
const UpdatePeerLocatedTypeID = 0xb4afcfb0
func (u *UpdatePeerLocated ) Zero () bool {
if u == nil {
return true
}
if !(u .Peers == nil ) {
return false
}
return true
}
func (u *UpdatePeerLocated ) String () string {
if u == nil {
return "UpdatePeerLocated(nil)"
}
type Alias UpdatePeerLocated
return fmt .Sprintf ("UpdatePeerLocated%+v" , Alias (*u ))
}
func (u *UpdatePeerLocated ) FillFrom (from interface {
GetPeers () (value []PeerLocatedClass )
}) {
u .Peers = from .GetPeers ()
}
func (*UpdatePeerLocated ) TypeID () uint32 {
return UpdatePeerLocatedTypeID
}
func (*UpdatePeerLocated ) TypeName () string {
return "updatePeerLocated"
}
func (u *UpdatePeerLocated ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerLocated" ,
ID : UpdatePeerLocatedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peers" ,
SchemaName : "peers" ,
},
}
return typ
}
func (u *UpdatePeerLocated ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerLocated#b4afcfb0 as nil" )
}
b .PutID (UpdatePeerLocatedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerLocated ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerLocated#b4afcfb0 as nil" )
}
b .PutVectorHeader (len (u .Peers ))
for idx , v := range u .Peers {
if v == nil {
return fmt .Errorf ("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdatePeerLocated ) GetPeers () (value []PeerLocatedClass ) {
return u .Peers
}
func (u *UpdatePeerLocated ) MapPeers () (value PeerLocatedClassArray ) {
return PeerLocatedClassArray (u .Peers )
}
func (u *UpdatePeerLocated ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerLocated#b4afcfb0 to nil" )
}
if err := b .ConsumeID (UpdatePeerLocatedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerLocated ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerLocated#b4afcfb0 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: field peers: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePeerLocated (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: field peers: %w" , err )
}
u .Peers = append (u .Peers , value )
}
}
return nil
}
func (u UpdatePeerLocated ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerLocated {}
_ bin .Decoder = &UpdatePeerLocated {}
_ bin .BareEncoder = &UpdatePeerLocated {}
_ bin .BareDecoder = &UpdatePeerLocated {}
_ UpdateClass = &UpdatePeerLocated {}
)
type UpdateNewScheduledMessage struct {
Message MessageClass
}
const UpdateNewScheduledMessageTypeID = 0x39a51dfb
func (u *UpdateNewScheduledMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
return true
}
func (u *UpdateNewScheduledMessage ) String () string {
if u == nil {
return "UpdateNewScheduledMessage(nil)"
}
type Alias UpdateNewScheduledMessage
return fmt .Sprintf ("UpdateNewScheduledMessage%+v" , Alias (*u ))
}
func (u *UpdateNewScheduledMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
}) {
u .Message = from .GetMessage ()
}
func (*UpdateNewScheduledMessage ) TypeID () uint32 {
return UpdateNewScheduledMessageTypeID
}
func (*UpdateNewScheduledMessage ) TypeName () string {
return "updateNewScheduledMessage"
}
func (u *UpdateNewScheduledMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewScheduledMessage" ,
ID : UpdateNewScheduledMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
}
return typ
}
func (u *UpdateNewScheduledMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewScheduledMessage#39a51dfb as nil" )
}
b .PutID (UpdateNewScheduledMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewScheduledMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewScheduledMessage#39a51dfb as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewScheduledMessage#39a51dfb: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewScheduledMessage#39a51dfb: field message: %w" , err )
}
return nil
}
func (u *UpdateNewScheduledMessage ) GetMessage () (value MessageClass ) {
return u .Message
}
func (u *UpdateNewScheduledMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewScheduledMessage#39a51dfb to nil" )
}
if err := b .ConsumeID (UpdateNewScheduledMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewScheduledMessage#39a51dfb: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewScheduledMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewScheduledMessage#39a51dfb to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewScheduledMessage#39a51dfb: field message: %w" , err )
}
u .Message = value
}
return nil
}
func (u UpdateNewScheduledMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewScheduledMessage {}
_ bin .Decoder = &UpdateNewScheduledMessage {}
_ bin .BareEncoder = &UpdateNewScheduledMessage {}
_ bin .BareDecoder = &UpdateNewScheduledMessage {}
_ UpdateClass = &UpdateNewScheduledMessage {}
)
type UpdateDeleteScheduledMessages struct {
Peer PeerClass
Messages []int
}
const UpdateDeleteScheduledMessagesTypeID = 0x90866cee
func (u *UpdateDeleteScheduledMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Messages == nil ) {
return false
}
return true
}
func (u *UpdateDeleteScheduledMessages ) String () string {
if u == nil {
return "UpdateDeleteScheduledMessages(nil)"
}
type Alias UpdateDeleteScheduledMessages
return fmt .Sprintf ("UpdateDeleteScheduledMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteScheduledMessages ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMessages () (value []int )
}) {
u .Peer = from .GetPeer ()
u .Messages = from .GetMessages ()
}
func (*UpdateDeleteScheduledMessages ) TypeID () uint32 {
return UpdateDeleteScheduledMessagesTypeID
}
func (*UpdateDeleteScheduledMessages ) TypeName () string {
return "updateDeleteScheduledMessages"
}
func (u *UpdateDeleteScheduledMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteScheduledMessages" ,
ID : UpdateDeleteScheduledMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
}
return typ
}
func (u *UpdateDeleteScheduledMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteScheduledMessages#90866cee as nil" )
}
b .PutID (UpdateDeleteScheduledMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteScheduledMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteScheduledMessages#90866cee as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDeleteScheduledMessages#90866cee: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDeleteScheduledMessages#90866cee: field peer: %w" , err )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
return nil
}
func (u *UpdateDeleteScheduledMessages ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateDeleteScheduledMessages ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdateDeleteScheduledMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteScheduledMessages#90866cee to nil" )
}
if err := b .ConsumeID (UpdateDeleteScheduledMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteScheduledMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteScheduledMessages#90866cee to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field peer: %w" , err )
}
u .Peer = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
return nil
}
func (u UpdateDeleteScheduledMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteScheduledMessages {}
_ bin .Decoder = &UpdateDeleteScheduledMessages {}
_ bin .BareEncoder = &UpdateDeleteScheduledMessages {}
_ bin .BareDecoder = &UpdateDeleteScheduledMessages {}
_ UpdateClass = &UpdateDeleteScheduledMessages {}
)
type UpdateTheme struct {
Theme Theme
}
const UpdateThemeTypeID = 0x8216fba3
func (u *UpdateTheme ) Zero () bool {
if u == nil {
return true
}
if !(u .Theme .Zero ()) {
return false
}
return true
}
func (u *UpdateTheme ) String () string {
if u == nil {
return "UpdateTheme(nil)"
}
type Alias UpdateTheme
return fmt .Sprintf ("UpdateTheme%+v" , Alias (*u ))
}
func (u *UpdateTheme ) FillFrom (from interface {
GetTheme () (value Theme )
}) {
u .Theme = from .GetTheme ()
}
func (*UpdateTheme ) TypeID () uint32 {
return UpdateThemeTypeID
}
func (*UpdateTheme ) TypeName () string {
return "updateTheme"
}
func (u *UpdateTheme ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateTheme" ,
ID : UpdateThemeTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Theme" ,
SchemaName : "theme" ,
},
}
return typ
}
func (u *UpdateTheme ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTheme#8216fba3 as nil" )
}
b .PutID (UpdateThemeTypeID )
return u .EncodeBare (b )
}
func (u *UpdateTheme ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTheme#8216fba3 as nil" )
}
if err := u .Theme .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateTheme#8216fba3: field theme: %w" , err )
}
return nil
}
func (u *UpdateTheme ) GetTheme () (value Theme ) {
return u .Theme
}
func (u *UpdateTheme ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTheme#8216fba3 to nil" )
}
if err := b .ConsumeID (UpdateThemeTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateTheme#8216fba3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateTheme ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTheme#8216fba3 to nil" )
}
{
if err := u .Theme .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateTheme#8216fba3: field theme: %w" , err )
}
}
return nil
}
func (u UpdateTheme ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateTheme {}
_ bin .Decoder = &UpdateTheme {}
_ bin .BareEncoder = &UpdateTheme {}
_ bin .BareDecoder = &UpdateTheme {}
_ UpdateClass = &UpdateTheme {}
)
type UpdateGeoLiveViewed struct {
Peer PeerClass
MsgID int
}
const UpdateGeoLiveViewedTypeID = 0x871fb939
func (u *UpdateGeoLiveViewed ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
return true
}
func (u *UpdateGeoLiveViewed ) String () string {
if u == nil {
return "UpdateGeoLiveViewed(nil)"
}
type Alias UpdateGeoLiveViewed
return fmt .Sprintf ("UpdateGeoLiveViewed%+v" , Alias (*u ))
}
func (u *UpdateGeoLiveViewed ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
}
func (*UpdateGeoLiveViewed ) TypeID () uint32 {
return UpdateGeoLiveViewedTypeID
}
func (*UpdateGeoLiveViewed ) TypeName () string {
return "updateGeoLiveViewed"
}
func (u *UpdateGeoLiveViewed ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGeoLiveViewed" ,
ID : UpdateGeoLiveViewedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
}
return typ
}
func (u *UpdateGeoLiveViewed ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGeoLiveViewed#871fb939 as nil" )
}
b .PutID (UpdateGeoLiveViewedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGeoLiveViewed ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGeoLiveViewed#871fb939 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateGeoLiveViewed#871fb939: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGeoLiveViewed#871fb939: field peer: %w" , err )
}
b .PutInt (u .MsgID )
return nil
}
func (u *UpdateGeoLiveViewed ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdateGeoLiveViewed ) GetMsgID () (value int ) {
return u .MsgID
}
func (u *UpdateGeoLiveViewed ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGeoLiveViewed#871fb939 to nil" )
}
if err := b .ConsumeID (UpdateGeoLiveViewedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGeoLiveViewed ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGeoLiveViewed#871fb939 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: field msg_id: %w" , err )
}
u .MsgID = value
}
return nil
}
func (u UpdateGeoLiveViewed ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGeoLiveViewed {}
_ bin .Decoder = &UpdateGeoLiveViewed {}
_ bin .BareEncoder = &UpdateGeoLiveViewed {}
_ bin .BareDecoder = &UpdateGeoLiveViewed {}
_ UpdateClass = &UpdateGeoLiveViewed {}
)
type UpdateLoginToken struct {
}
const UpdateLoginTokenTypeID = 0x564fe691
func (u *UpdateLoginToken ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateLoginToken ) String () string {
if u == nil {
return "UpdateLoginToken(nil)"
}
type Alias UpdateLoginToken
return fmt .Sprintf ("UpdateLoginToken%+v" , Alias (*u ))
}
func (*UpdateLoginToken ) TypeID () uint32 {
return UpdateLoginTokenTypeID
}
func (*UpdateLoginToken ) TypeName () string {
return "updateLoginToken"
}
func (u *UpdateLoginToken ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLoginToken" ,
ID : UpdateLoginTokenTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateLoginToken ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLoginToken#564fe691 as nil" )
}
b .PutID (UpdateLoginTokenTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLoginToken ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLoginToken#564fe691 as nil" )
}
return nil
}
func (u *UpdateLoginToken ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLoginToken#564fe691 to nil" )
}
if err := b .ConsumeID (UpdateLoginTokenTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLoginToken#564fe691: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLoginToken ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLoginToken#564fe691 to nil" )
}
return nil
}
func (u UpdateLoginToken ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLoginToken {}
_ bin .Decoder = &UpdateLoginToken {}
_ bin .BareEncoder = &UpdateLoginToken {}
_ bin .BareDecoder = &UpdateLoginToken {}
_ UpdateClass = &UpdateLoginToken {}
)
type UpdateMessagePollVote struct {
PollID int64
UserID int
Options [][]byte
}
const UpdateMessagePollVoteTypeID = 0x42f88f2c
func (u *UpdateMessagePollVote ) Zero () bool {
if u == nil {
return true
}
if !(u .PollID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Options == nil ) {
return false
}
return true
}
func (u *UpdateMessagePollVote ) String () string {
if u == nil {
return "UpdateMessagePollVote(nil)"
}
type Alias UpdateMessagePollVote
return fmt .Sprintf ("UpdateMessagePollVote%+v" , Alias (*u ))
}
func (u *UpdateMessagePollVote ) FillFrom (from interface {
GetPollID () (value int64 )
GetUserID () (value int )
GetOptions () (value [][]byte )
}) {
u .PollID = from .GetPollID ()
u .UserID = from .GetUserID ()
u .Options = from .GetOptions ()
}
func (*UpdateMessagePollVote ) TypeID () uint32 {
return UpdateMessagePollVoteTypeID
}
func (*UpdateMessagePollVote ) TypeName () string {
return "updateMessagePollVote"
}
func (u *UpdateMessagePollVote ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessagePollVote" ,
ID : UpdateMessagePollVoteTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PollID" ,
SchemaName : "poll_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Options" ,
SchemaName : "options" ,
},
}
return typ
}
func (u *UpdateMessagePollVote ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePollVote#42f88f2c as nil" )
}
b .PutID (UpdateMessagePollVoteTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessagePollVote ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePollVote#42f88f2c as nil" )
}
b .PutLong (u .PollID )
b .PutInt (u .UserID )
b .PutVectorHeader (len (u .Options ))
for _ , v := range u .Options {
b .PutBytes (v )
}
return nil
}
func (u *UpdateMessagePollVote ) GetPollID () (value int64 ) {
return u .PollID
}
func (u *UpdateMessagePollVote ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateMessagePollVote ) GetOptions () (value [][]byte ) {
return u .Options
}
func (u *UpdateMessagePollVote ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePollVote#42f88f2c to nil" )
}
if err := b .ConsumeID (UpdateMessagePollVoteTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#42f88f2c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessagePollVote ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePollVote#42f88f2c to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#42f88f2c: field poll_id: %w" , err )
}
u .PollID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#42f88f2c: field user_id: %w" , err )
}
u .UserID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#42f88f2c: field options: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#42f88f2c: field options: %w" , err )
}
u .Options = append (u .Options , value )
}
}
return nil
}
func (u UpdateMessagePollVote ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessagePollVote {}
_ bin .Decoder = &UpdateMessagePollVote {}
_ bin .BareEncoder = &UpdateMessagePollVote {}
_ bin .BareDecoder = &UpdateMessagePollVote {}
_ UpdateClass = &UpdateMessagePollVote {}
)
type UpdateDialogFilter struct {
Flags bin .Fields
ID int
Filter DialogFilter
}
const UpdateDialogFilterTypeID = 0x26ffde7d
func (u *UpdateDialogFilter ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Filter .Zero ()) {
return false
}
return true
}
func (u *UpdateDialogFilter ) String () string {
if u == nil {
return "UpdateDialogFilter(nil)"
}
type Alias UpdateDialogFilter
return fmt .Sprintf ("UpdateDialogFilter%+v" , Alias (*u ))
}
func (u *UpdateDialogFilter ) FillFrom (from interface {
GetID () (value int )
GetFilter () (value DialogFilter , ok bool )
}) {
u .ID = from .GetID ()
if val , ok := from .GetFilter (); ok {
u .Filter = val
}
}
func (*UpdateDialogFilter ) TypeID () uint32 {
return UpdateDialogFilterTypeID
}
func (*UpdateDialogFilter ) TypeName () string {
return "updateDialogFilter"
}
func (u *UpdateDialogFilter ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilter" ,
ID : UpdateDialogFilterTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Filter" ,
SchemaName : "filter" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateDialogFilter ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilter#26ffde7d as nil" )
}
b .PutID (UpdateDialogFilterTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilter ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilter#26ffde7d as nil" )
}
if !(u .Filter .Zero ()) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogFilter#26ffde7d: field flags: %w" , err )
}
b .PutInt (u .ID )
if u .Flags .Has (0 ) {
if err := u .Filter .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogFilter#26ffde7d: field filter: %w" , err )
}
}
return nil
}
func (u *UpdateDialogFilter ) GetID () (value int ) {
return u .ID
}
func (u *UpdateDialogFilter ) SetFilter (value DialogFilter ) {
u .Flags .Set (0 )
u .Filter = value
}
func (u *UpdateDialogFilter ) GetFilter () (value DialogFilter , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .Filter , true
}
func (u *UpdateDialogFilter ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilter#26ffde7d to nil" )
}
if err := b .ConsumeID (UpdateDialogFilterTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilter ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilter#26ffde7d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field id: %w" , err )
}
u .ID = value
}
if u .Flags .Has (0 ) {
if err := u .Filter .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field filter: %w" , err )
}
}
return nil
}
func (u UpdateDialogFilter ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilter {}
_ bin .Decoder = &UpdateDialogFilter {}
_ bin .BareEncoder = &UpdateDialogFilter {}
_ bin .BareDecoder = &UpdateDialogFilter {}
_ UpdateClass = &UpdateDialogFilter {}
)
type UpdateDialogFilterOrder struct {
Order []int
}
const UpdateDialogFilterOrderTypeID = 0xa5d72105
func (u *UpdateDialogFilterOrder ) Zero () bool {
if u == nil {
return true
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdateDialogFilterOrder ) String () string {
if u == nil {
return "UpdateDialogFilterOrder(nil)"
}
type Alias UpdateDialogFilterOrder
return fmt .Sprintf ("UpdateDialogFilterOrder%+v" , Alias (*u ))
}
func (u *UpdateDialogFilterOrder ) FillFrom (from interface {
GetOrder () (value []int )
}) {
u .Order = from .GetOrder ()
}
func (*UpdateDialogFilterOrder ) TypeID () uint32 {
return UpdateDialogFilterOrderTypeID
}
func (*UpdateDialogFilterOrder ) TypeName () string {
return "updateDialogFilterOrder"
}
func (u *UpdateDialogFilterOrder ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilterOrder" ,
ID : UpdateDialogFilterOrderTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Order" ,
SchemaName : "order" ,
},
}
return typ
}
func (u *UpdateDialogFilterOrder ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilterOrder#a5d72105 as nil" )
}
b .PutID (UpdateDialogFilterOrderTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilterOrder ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilterOrder#a5d72105 as nil" )
}
b .PutVectorHeader (len (u .Order ))
for _ , v := range u .Order {
b .PutInt (v )
}
return nil
}
func (u *UpdateDialogFilterOrder ) GetOrder () (value []int ) {
return u .Order
}
func (u *UpdateDialogFilterOrder ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilterOrder#a5d72105 to nil" )
}
if err := b .ConsumeID (UpdateDialogFilterOrderTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilterOrder ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilterOrder#a5d72105 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: field order: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u UpdateDialogFilterOrder ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilterOrder {}
_ bin .Decoder = &UpdateDialogFilterOrder {}
_ bin .BareEncoder = &UpdateDialogFilterOrder {}
_ bin .BareDecoder = &UpdateDialogFilterOrder {}
_ UpdateClass = &UpdateDialogFilterOrder {}
)
type UpdateDialogFilters struct {
}
const UpdateDialogFiltersTypeID = 0x3504914f
func (u *UpdateDialogFilters ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateDialogFilters ) String () string {
if u == nil {
return "UpdateDialogFilters(nil)"
}
type Alias UpdateDialogFilters
return fmt .Sprintf ("UpdateDialogFilters%+v" , Alias (*u ))
}
func (*UpdateDialogFilters ) TypeID () uint32 {
return UpdateDialogFiltersTypeID
}
func (*UpdateDialogFilters ) TypeName () string {
return "updateDialogFilters"
}
func (u *UpdateDialogFilters ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilters" ,
ID : UpdateDialogFiltersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateDialogFilters ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilters#3504914f as nil" )
}
b .PutID (UpdateDialogFiltersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilters ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilters#3504914f as nil" )
}
return nil
}
func (u *UpdateDialogFilters ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilters#3504914f to nil" )
}
if err := b .ConsumeID (UpdateDialogFiltersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilters#3504914f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilters ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilters#3504914f to nil" )
}
return nil
}
func (u UpdateDialogFilters ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilters {}
_ bin .Decoder = &UpdateDialogFilters {}
_ bin .BareEncoder = &UpdateDialogFilters {}
_ bin .BareDecoder = &UpdateDialogFilters {}
_ UpdateClass = &UpdateDialogFilters {}
)
type UpdatePhoneCallSignalingData struct {
PhoneCallID int64
Data []byte
}
const UpdatePhoneCallSignalingDataTypeID = 0x2661bf09
func (u *UpdatePhoneCallSignalingData ) Zero () bool {
if u == nil {
return true
}
if !(u .PhoneCallID == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
return true
}
func (u *UpdatePhoneCallSignalingData ) String () string {
if u == nil {
return "UpdatePhoneCallSignalingData(nil)"
}
type Alias UpdatePhoneCallSignalingData
return fmt .Sprintf ("UpdatePhoneCallSignalingData%+v" , Alias (*u ))
}
func (u *UpdatePhoneCallSignalingData ) FillFrom (from interface {
GetPhoneCallID () (value int64 )
GetData () (value []byte )
}) {
u .PhoneCallID = from .GetPhoneCallID ()
u .Data = from .GetData ()
}
func (*UpdatePhoneCallSignalingData ) TypeID () uint32 {
return UpdatePhoneCallSignalingDataTypeID
}
func (*UpdatePhoneCallSignalingData ) TypeName () string {
return "updatePhoneCallSignalingData"
}
func (u *UpdatePhoneCallSignalingData ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePhoneCallSignalingData" ,
ID : UpdatePhoneCallSignalingDataTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PhoneCallID" ,
SchemaName : "phone_call_id" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
},
}
return typ
}
func (u *UpdatePhoneCallSignalingData ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCallSignalingData#2661bf09 as nil" )
}
b .PutID (UpdatePhoneCallSignalingDataTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePhoneCallSignalingData ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCallSignalingData#2661bf09 as nil" )
}
b .PutLong (u .PhoneCallID )
b .PutBytes (u .Data )
return nil
}
func (u *UpdatePhoneCallSignalingData ) GetPhoneCallID () (value int64 ) {
return u .PhoneCallID
}
func (u *UpdatePhoneCallSignalingData ) GetData () (value []byte ) {
return u .Data
}
func (u *UpdatePhoneCallSignalingData ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCallSignalingData#2661bf09 to nil" )
}
if err := b .ConsumeID (UpdatePhoneCallSignalingDataTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePhoneCallSignalingData ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCallSignalingData#2661bf09 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: field phone_call_id: %w" , err )
}
u .PhoneCallID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: field data: %w" , err )
}
u .Data = value
}
return nil
}
func (u UpdatePhoneCallSignalingData ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePhoneCallSignalingData {}
_ bin .Decoder = &UpdatePhoneCallSignalingData {}
_ bin .BareEncoder = &UpdatePhoneCallSignalingData {}
_ bin .BareDecoder = &UpdatePhoneCallSignalingData {}
_ UpdateClass = &UpdatePhoneCallSignalingData {}
)
type UpdateChannelMessageForwards struct {
ChannelID int
ID int
Forwards int
}
const UpdateChannelMessageForwardsTypeID = 0x6e8a84df
func (u *UpdateChannelMessageForwards ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Forwards == 0 ) {
return false
}
return true
}
func (u *UpdateChannelMessageForwards ) String () string {
if u == nil {
return "UpdateChannelMessageForwards(nil)"
}
type Alias UpdateChannelMessageForwards
return fmt .Sprintf ("UpdateChannelMessageForwards%+v" , Alias (*u ))
}
func (u *UpdateChannelMessageForwards ) FillFrom (from interface {
GetChannelID () (value int )
GetID () (value int )
GetForwards () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .ID = from .GetID ()
u .Forwards = from .GetForwards ()
}
func (*UpdateChannelMessageForwards ) TypeID () uint32 {
return UpdateChannelMessageForwardsTypeID
}
func (*UpdateChannelMessageForwards ) TypeName () string {
return "updateChannelMessageForwards"
}
func (u *UpdateChannelMessageForwards ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelMessageForwards" ,
ID : UpdateChannelMessageForwardsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Forwards" ,
SchemaName : "forwards" ,
},
}
return typ
}
func (u *UpdateChannelMessageForwards ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageForwards#6e8a84df as nil" )
}
b .PutID (UpdateChannelMessageForwardsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelMessageForwards ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageForwards#6e8a84df as nil" )
}
b .PutInt (u .ChannelID )
b .PutInt (u .ID )
b .PutInt (u .Forwards )
return nil
}
func (u *UpdateChannelMessageForwards ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelMessageForwards ) GetID () (value int ) {
return u .ID
}
func (u *UpdateChannelMessageForwards ) GetForwards () (value int ) {
return u .Forwards
}
func (u *UpdateChannelMessageForwards ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageForwards#6e8a84df to nil" )
}
if err := b .ConsumeID (UpdateChannelMessageForwardsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#6e8a84df: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelMessageForwards ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageForwards#6e8a84df to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#6e8a84df: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#6e8a84df: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#6e8a84df: field forwards: %w" , err )
}
u .Forwards = value
}
return nil
}
func (u UpdateChannelMessageForwards ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelMessageForwards {}
_ bin .Decoder = &UpdateChannelMessageForwards {}
_ bin .BareEncoder = &UpdateChannelMessageForwards {}
_ bin .BareDecoder = &UpdateChannelMessageForwards {}
_ UpdateClass = &UpdateChannelMessageForwards {}
)
type UpdateReadChannelDiscussionInbox struct {
Flags bin .Fields
ChannelID int
TopMsgID int
ReadMaxID int
BroadcastID int
BroadcastPost int
}
const UpdateReadChannelDiscussionInboxTypeID = 0x1cc7de54
func (u *UpdateReadChannelDiscussionInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .ReadMaxID == 0 ) {
return false
}
if !(u .BroadcastID == 0 ) {
return false
}
if !(u .BroadcastPost == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelDiscussionInbox ) String () string {
if u == nil {
return "UpdateReadChannelDiscussionInbox(nil)"
}
type Alias UpdateReadChannelDiscussionInbox
return fmt .Sprintf ("UpdateReadChannelDiscussionInbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelDiscussionInbox ) FillFrom (from interface {
GetChannelID () (value int )
GetTopMsgID () (value int )
GetReadMaxID () (value int )
GetBroadcastID () (value int , ok bool )
GetBroadcastPost () (value int , ok bool )
}) {
u .ChannelID = from .GetChannelID ()
u .TopMsgID = from .GetTopMsgID ()
u .ReadMaxID = from .GetReadMaxID ()
if val , ok := from .GetBroadcastID (); ok {
u .BroadcastID = val
}
if val , ok := from .GetBroadcastPost (); ok {
u .BroadcastPost = val
}
}
func (*UpdateReadChannelDiscussionInbox ) TypeID () uint32 {
return UpdateReadChannelDiscussionInboxTypeID
}
func (*UpdateReadChannelDiscussionInbox ) TypeName () string {
return "updateReadChannelDiscussionInbox"
}
func (u *UpdateReadChannelDiscussionInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelDiscussionInbox" ,
ID : UpdateReadChannelDiscussionInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
},
{
Name : "ReadMaxID" ,
SchemaName : "read_max_id" ,
},
{
Name : "BroadcastID" ,
SchemaName : "broadcast_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "BroadcastPost" ,
SchemaName : "broadcast_post" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateReadChannelDiscussionInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionInbox#1cc7de54 as nil" )
}
b .PutID (UpdateReadChannelDiscussionInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelDiscussionInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionInbox#1cc7de54 as nil" )
}
if !(u .BroadcastID == 0 ) {
u .Flags .Set (0 )
}
if !(u .BroadcastPost == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadChannelDiscussionInbox#1cc7de54: field flags: %w" , err )
}
b .PutInt (u .ChannelID )
b .PutInt (u .TopMsgID )
b .PutInt (u .ReadMaxID )
if u .Flags .Has (0 ) {
b .PutInt (u .BroadcastID )
}
if u .Flags .Has (0 ) {
b .PutInt (u .BroadcastPost )
}
return nil
}
func (u *UpdateReadChannelDiscussionInbox ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateReadChannelDiscussionInbox ) GetTopMsgID () (value int ) {
return u .TopMsgID
}
func (u *UpdateReadChannelDiscussionInbox ) GetReadMaxID () (value int ) {
return u .ReadMaxID
}
func (u *UpdateReadChannelDiscussionInbox ) SetBroadcastID (value int ) {
u .Flags .Set (0 )
u .BroadcastID = value
}
func (u *UpdateReadChannelDiscussionInbox ) GetBroadcastID () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .BroadcastID , true
}
func (u *UpdateReadChannelDiscussionInbox ) SetBroadcastPost (value int ) {
u .Flags .Set (0 )
u .BroadcastPost = value
}
func (u *UpdateReadChannelDiscussionInbox ) GetBroadcastPost () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .BroadcastPost , true
}
func (u *UpdateReadChannelDiscussionInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionInbox#1cc7de54 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelDiscussionInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelDiscussionInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionInbox#1cc7de54 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field read_max_id: %w" , err )
}
u .ReadMaxID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field broadcast_id: %w" , err )
}
u .BroadcastID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field broadcast_post: %w" , err )
}
u .BroadcastPost = value
}
return nil
}
func (u UpdateReadChannelDiscussionInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelDiscussionInbox {}
_ bin .Decoder = &UpdateReadChannelDiscussionInbox {}
_ bin .BareEncoder = &UpdateReadChannelDiscussionInbox {}
_ bin .BareDecoder = &UpdateReadChannelDiscussionInbox {}
_ UpdateClass = &UpdateReadChannelDiscussionInbox {}
)
type UpdateReadChannelDiscussionOutbox struct {
ChannelID int
TopMsgID int
ReadMaxID int
}
const UpdateReadChannelDiscussionOutboxTypeID = 0x4638a26c
func (u *UpdateReadChannelDiscussionOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .ReadMaxID == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelDiscussionOutbox ) String () string {
if u == nil {
return "UpdateReadChannelDiscussionOutbox(nil)"
}
type Alias UpdateReadChannelDiscussionOutbox
return fmt .Sprintf ("UpdateReadChannelDiscussionOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelDiscussionOutbox ) FillFrom (from interface {
GetChannelID () (value int )
GetTopMsgID () (value int )
GetReadMaxID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .TopMsgID = from .GetTopMsgID ()
u .ReadMaxID = from .GetReadMaxID ()
}
func (*UpdateReadChannelDiscussionOutbox ) TypeID () uint32 {
return UpdateReadChannelDiscussionOutboxTypeID
}
func (*UpdateReadChannelDiscussionOutbox ) TypeName () string {
return "updateReadChannelDiscussionOutbox"
}
func (u *UpdateReadChannelDiscussionOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelDiscussionOutbox" ,
ID : UpdateReadChannelDiscussionOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
},
{
Name : "ReadMaxID" ,
SchemaName : "read_max_id" ,
},
}
return typ
}
func (u *UpdateReadChannelDiscussionOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionOutbox#4638a26c as nil" )
}
b .PutID (UpdateReadChannelDiscussionOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelDiscussionOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionOutbox#4638a26c as nil" )
}
b .PutInt (u .ChannelID )
b .PutInt (u .TopMsgID )
b .PutInt (u .ReadMaxID )
return nil
}
func (u *UpdateReadChannelDiscussionOutbox ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateReadChannelDiscussionOutbox ) GetTopMsgID () (value int ) {
return u .TopMsgID
}
func (u *UpdateReadChannelDiscussionOutbox ) GetReadMaxID () (value int ) {
return u .ReadMaxID
}
func (u *UpdateReadChannelDiscussionOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionOutbox#4638a26c to nil" )
}
if err := b .ConsumeID (UpdateReadChannelDiscussionOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#4638a26c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelDiscussionOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionOutbox#4638a26c to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field read_max_id: %w" , err )
}
u .ReadMaxID = value
}
return nil
}
func (u UpdateReadChannelDiscussionOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .Decoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .BareEncoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .BareDecoder = &UpdateReadChannelDiscussionOutbox {}
_ UpdateClass = &UpdateReadChannelDiscussionOutbox {}
)
type UpdatePeerBlocked struct {
PeerID PeerClass
Blocked bool
}
const UpdatePeerBlockedTypeID = 0x246a4b22
func (u *UpdatePeerBlocked ) Zero () bool {
if u == nil {
return true
}
if !(u .PeerID == nil ) {
return false
}
if !(u .Blocked == false ) {
return false
}
return true
}
func (u *UpdatePeerBlocked ) String () string {
if u == nil {
return "UpdatePeerBlocked(nil)"
}
type Alias UpdatePeerBlocked
return fmt .Sprintf ("UpdatePeerBlocked%+v" , Alias (*u ))
}
func (u *UpdatePeerBlocked ) FillFrom (from interface {
GetPeerID () (value PeerClass )
GetBlocked () (value bool )
}) {
u .PeerID = from .GetPeerID ()
u .Blocked = from .GetBlocked ()
}
func (*UpdatePeerBlocked ) TypeID () uint32 {
return UpdatePeerBlockedTypeID
}
func (*UpdatePeerBlocked ) TypeName () string {
return "updatePeerBlocked"
}
func (u *UpdatePeerBlocked ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerBlocked" ,
ID : UpdatePeerBlockedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PeerID" ,
SchemaName : "peer_id" ,
},
{
Name : "Blocked" ,
SchemaName : "blocked" ,
},
}
return typ
}
func (u *UpdatePeerBlocked ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerBlocked#246a4b22 as nil" )
}
b .PutID (UpdatePeerBlockedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerBlocked ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerBlocked#246a4b22 as nil" )
}
if u .PeerID == nil {
return fmt .Errorf ("unable to encode updatePeerBlocked#246a4b22: field peer_id is nil" )
}
if err := u .PeerID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerBlocked#246a4b22: field peer_id: %w" , err )
}
b .PutBool (u .Blocked )
return nil
}
func (u *UpdatePeerBlocked ) GetPeerID () (value PeerClass ) {
return u .PeerID
}
func (u *UpdatePeerBlocked ) GetBlocked () (value bool ) {
return u .Blocked
}
func (u *UpdatePeerBlocked ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerBlocked#246a4b22 to nil" )
}
if err := b .ConsumeID (UpdatePeerBlockedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#246a4b22: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerBlocked ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerBlocked#246a4b22 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#246a4b22: field peer_id: %w" , err )
}
u .PeerID = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#246a4b22: field blocked: %w" , err )
}
u .Blocked = value
}
return nil
}
func (u UpdatePeerBlocked ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerBlocked {}
_ bin .Decoder = &UpdatePeerBlocked {}
_ bin .BareEncoder = &UpdatePeerBlocked {}
_ bin .BareDecoder = &UpdatePeerBlocked {}
_ UpdateClass = &UpdatePeerBlocked {}
)
type UpdateChannelUserTyping struct {
Flags bin .Fields
ChannelID int
TopMsgID int
FromID PeerClass
Action SendMessageActionClass
}
const UpdateChannelUserTypingTypeID = 0x6b171718
func (u *UpdateChannelUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .FromID == nil ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateChannelUserTyping ) String () string {
if u == nil {
return "UpdateChannelUserTyping(nil)"
}
type Alias UpdateChannelUserTyping
return fmt .Sprintf ("UpdateChannelUserTyping%+v" , Alias (*u ))
}
func (u *UpdateChannelUserTyping ) FillFrom (from interface {
GetChannelID () (value int )
GetTopMsgID () (value int , ok bool )
GetFromID () (value PeerClass )
GetAction () (value SendMessageActionClass )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetTopMsgID (); ok {
u .TopMsgID = val
}
u .FromID = from .GetFromID ()
u .Action = from .GetAction ()
}
func (*UpdateChannelUserTyping ) TypeID () uint32 {
return UpdateChannelUserTypingTypeID
}
func (*UpdateChannelUserTyping ) TypeName () string {
return "updateChannelUserTyping"
}
func (u *UpdateChannelUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelUserTyping" ,
ID : UpdateChannelUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "FromID" ,
SchemaName : "from_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateChannelUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelUserTyping#6b171718 as nil" )
}
b .PutID (UpdateChannelUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelUserTyping#6b171718 as nil" )
}
if !(u .TopMsgID == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#6b171718: field flags: %w" , err )
}
b .PutInt (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutInt (u .TopMsgID )
}
if u .FromID == nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#6b171718: field from_id is nil" )
}
if err := u .FromID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#6b171718: field from_id: %w" , err )
}
if u .Action == nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#6b171718: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#6b171718: field action: %w" , err )
}
return nil
}
func (u *UpdateChannelUserTyping ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelUserTyping ) SetTopMsgID (value int ) {
u .Flags .Set (0 )
u .TopMsgID = value
}
func (u *UpdateChannelUserTyping ) GetTopMsgID () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .TopMsgID , true
}
func (u *UpdateChannelUserTyping ) GetFromID () (value PeerClass ) {
return u .FromID
}
func (u *UpdateChannelUserTyping ) GetAction () (value SendMessageActionClass ) {
return u .Action
}
func (u *UpdateChannelUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelUserTyping#6b171718 to nil" )
}
if err := b .ConsumeID (UpdateChannelUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelUserTyping#6b171718 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: field from_id: %w" , err )
}
u .FromID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#6b171718: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u UpdateChannelUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelUserTyping {}
_ bin .Decoder = &UpdateChannelUserTyping {}
_ bin .BareEncoder = &UpdateChannelUserTyping {}
_ bin .BareDecoder = &UpdateChannelUserTyping {}
_ UpdateClass = &UpdateChannelUserTyping {}
)
type UpdatePinnedMessages struct {
Flags bin .Fields
Pinned bool
Peer PeerClass
Messages []int
Pts int
PtsCount int
}
const UpdatePinnedMessagesTypeID = 0xed85eab5
func (u *UpdatePinnedMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdatePinnedMessages ) String () string {
if u == nil {
return "UpdatePinnedMessages(nil)"
}
type Alias UpdatePinnedMessages
return fmt .Sprintf ("UpdatePinnedMessages%+v" , Alias (*u ))
}
func (u *UpdatePinnedMessages ) FillFrom (from interface {
GetPinned () (value bool )
GetPeer () (value PeerClass )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Pinned = from .GetPinned ()
u .Peer = from .GetPeer ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdatePinnedMessages ) TypeID () uint32 {
return UpdatePinnedMessagesTypeID
}
func (*UpdatePinnedMessages ) TypeName () string {
return "updatePinnedMessages"
}
func (u *UpdatePinnedMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedMessages" ,
ID : UpdatePinnedMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdatePinnedMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedMessages#ed85eab5 as nil" )
}
b .PutID (UpdatePinnedMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedMessages#ed85eab5 as nil" )
}
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field peer: %w" , err )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdatePinnedMessages ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdatePinnedMessages ) GetPinned () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdatePinnedMessages ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdatePinnedMessages ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdatePinnedMessages ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdatePinnedMessages ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdatePinnedMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedMessages#ed85eab5 to nil" )
}
if err := b .ConsumeID (UpdatePinnedMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedMessages#ed85eab5 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field peer: %w" , err )
}
u .Peer = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdatePinnedMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedMessages {}
_ bin .Decoder = &UpdatePinnedMessages {}
_ bin .BareEncoder = &UpdatePinnedMessages {}
_ bin .BareDecoder = &UpdatePinnedMessages {}
_ UpdateClass = &UpdatePinnedMessages {}
)
type UpdatePinnedChannelMessages struct {
Flags bin .Fields
Pinned bool
ChannelID int
Messages []int
Pts int
PtsCount int
}
const UpdatePinnedChannelMessagesTypeID = 0x8588878b
func (u *UpdatePinnedChannelMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdatePinnedChannelMessages ) String () string {
if u == nil {
return "UpdatePinnedChannelMessages(nil)"
}
type Alias UpdatePinnedChannelMessages
return fmt .Sprintf ("UpdatePinnedChannelMessages%+v" , Alias (*u ))
}
func (u *UpdatePinnedChannelMessages ) FillFrom (from interface {
GetPinned () (value bool )
GetChannelID () (value int )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Pinned = from .GetPinned ()
u .ChannelID = from .GetChannelID ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdatePinnedChannelMessages ) TypeID () uint32 {
return UpdatePinnedChannelMessagesTypeID
}
func (*UpdatePinnedChannelMessages ) TypeName () string {
return "updatePinnedChannelMessages"
}
func (u *UpdatePinnedChannelMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedChannelMessages" ,
ID : UpdatePinnedChannelMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdatePinnedChannelMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedChannelMessages#8588878b as nil" )
}
b .PutID (UpdatePinnedChannelMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedChannelMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedChannelMessages#8588878b as nil" )
}
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedChannelMessages#8588878b: field flags: %w" , err )
}
b .PutInt (u .ChannelID )
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdatePinnedChannelMessages ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdatePinnedChannelMessages ) GetPinned () (value bool ) {
return u .Flags .Has (0 )
}
func (u *UpdatePinnedChannelMessages ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdatePinnedChannelMessages ) GetMessages () (value []int ) {
return u .Messages
}
func (u *UpdatePinnedChannelMessages ) GetPts () (value int ) {
return u .Pts
}
func (u *UpdatePinnedChannelMessages ) GetPtsCount () (value int ) {
return u .PtsCount
}
func (u *UpdatePinnedChannelMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedChannelMessages#8588878b to nil" )
}
if err := b .ConsumeID (UpdatePinnedChannelMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedChannelMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedChannelMessages#8588878b to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field messages: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#8588878b: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u UpdatePinnedChannelMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedChannelMessages {}
_ bin .Decoder = &UpdatePinnedChannelMessages {}
_ bin .BareEncoder = &UpdatePinnedChannelMessages {}
_ bin .BareDecoder = &UpdatePinnedChannelMessages {}
_ UpdateClass = &UpdatePinnedChannelMessages {}
)
type UpdateChat struct {
ChatID int
}
const UpdateChatTypeID = 0x1330a196
func (u *UpdateChat ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
return true
}
func (u *UpdateChat ) String () string {
if u == nil {
return "UpdateChat(nil)"
}
type Alias UpdateChat
return fmt .Sprintf ("UpdateChat%+v" , Alias (*u ))
}
func (u *UpdateChat ) FillFrom (from interface {
GetChatID () (value int )
}) {
u .ChatID = from .GetChatID ()
}
func (*UpdateChat ) TypeID () uint32 {
return UpdateChatTypeID
}
func (*UpdateChat ) TypeName () string {
return "updateChat"
}
func (u *UpdateChat ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChat" ,
ID : UpdateChatTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (u *UpdateChat ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChat#1330a196 as nil" )
}
b .PutID (UpdateChatTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChat ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChat#1330a196 as nil" )
}
b .PutInt (u .ChatID )
return nil
}
func (u *UpdateChat ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChat ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChat#1330a196 to nil" )
}
if err := b .ConsumeID (UpdateChatTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChat#1330a196: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChat ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChat#1330a196 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChat#1330a196: field chat_id: %w" , err )
}
u .ChatID = value
}
return nil
}
func (u UpdateChat ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChat {}
_ bin .Decoder = &UpdateChat {}
_ bin .BareEncoder = &UpdateChat {}
_ bin .BareDecoder = &UpdateChat {}
_ UpdateClass = &UpdateChat {}
)
type UpdateGroupCallParticipants struct {
Call InputGroupCall
Participants []GroupCallParticipant
Version int
}
const UpdateGroupCallParticipantsTypeID = 0xf2ebdb4e
func (u *UpdateGroupCallParticipants ) Zero () bool {
if u == nil {
return true
}
if !(u .Call .Zero ()) {
return false
}
if !(u .Participants == nil ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateGroupCallParticipants ) String () string {
if u == nil {
return "UpdateGroupCallParticipants(nil)"
}
type Alias UpdateGroupCallParticipants
return fmt .Sprintf ("UpdateGroupCallParticipants%+v" , Alias (*u ))
}
func (u *UpdateGroupCallParticipants ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetParticipants () (value []GroupCallParticipant )
GetVersion () (value int )
}) {
u .Call = from .GetCall ()
u .Participants = from .GetParticipants ()
u .Version = from .GetVersion ()
}
func (*UpdateGroupCallParticipants ) TypeID () uint32 {
return UpdateGroupCallParticipantsTypeID
}
func (*UpdateGroupCallParticipants ) TypeName () string {
return "updateGroupCallParticipants"
}
func (u *UpdateGroupCallParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupCallParticipants" ,
ID : UpdateGroupCallParticipantsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Participants" ,
SchemaName : "participants" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateGroupCallParticipants ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallParticipants#f2ebdb4e as nil" )
}
b .PutID (UpdateGroupCallParticipantsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupCallParticipants ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallParticipants#f2ebdb4e as nil" )
}
if err := u .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallParticipants#f2ebdb4e: field call: %w" , err )
}
b .PutVectorHeader (len (u .Participants ))
for idx , v := range u .Participants {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallParticipants#f2ebdb4e: field participants element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Version )
return nil
}
func (u *UpdateGroupCallParticipants ) GetCall () (value InputGroupCall ) {
return u .Call
}
func (u *UpdateGroupCallParticipants ) GetParticipants () (value []GroupCallParticipant ) {
return u .Participants
}
func (u *UpdateGroupCallParticipants ) GetVersion () (value int ) {
return u .Version
}
func (u *UpdateGroupCallParticipants ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallParticipants#f2ebdb4e to nil" )
}
if err := b .ConsumeID (UpdateGroupCallParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupCallParticipants ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallParticipants#f2ebdb4e to nil" )
}
{
if err := u .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field call: %w" , err )
}
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w" , err )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value GroupCallParticipant
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w" , err )
}
u .Participants = append (u .Participants , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u UpdateGroupCallParticipants ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupCallParticipants {}
_ bin .Decoder = &UpdateGroupCallParticipants {}
_ bin .BareEncoder = &UpdateGroupCallParticipants {}
_ bin .BareDecoder = &UpdateGroupCallParticipants {}
_ UpdateClass = &UpdateGroupCallParticipants {}
)
type UpdateGroupCall struct {
ChatID int
Call GroupCallClass
}
const UpdateGroupCallTypeID = 0xa45eb99b
func (u *UpdateGroupCall ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .Call == nil ) {
return false
}
return true
}
func (u *UpdateGroupCall ) String () string {
if u == nil {
return "UpdateGroupCall(nil)"
}
type Alias UpdateGroupCall
return fmt .Sprintf ("UpdateGroupCall%+v" , Alias (*u ))
}
func (u *UpdateGroupCall ) FillFrom (from interface {
GetChatID () (value int )
GetCall () (value GroupCallClass )
}) {
u .ChatID = from .GetChatID ()
u .Call = from .GetCall ()
}
func (*UpdateGroupCall ) TypeID () uint32 {
return UpdateGroupCallTypeID
}
func (*UpdateGroupCall ) TypeName () string {
return "updateGroupCall"
}
func (u *UpdateGroupCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupCall" ,
ID : UpdateGroupCallTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "Call" ,
SchemaName : "call" ,
},
}
return typ
}
func (u *UpdateGroupCall ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCall#a45eb99b as nil" )
}
b .PutID (UpdateGroupCallTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupCall ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCall#a45eb99b as nil" )
}
b .PutInt (u .ChatID )
if u .Call == nil {
return fmt .Errorf ("unable to encode updateGroupCall#a45eb99b: field call is nil" )
}
if err := u .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCall#a45eb99b: field call: %w" , err )
}
return nil
}
func (u *UpdateGroupCall ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateGroupCall ) GetCall () (value GroupCallClass ) {
return u .Call
}
func (u *UpdateGroupCall ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCall#a45eb99b to nil" )
}
if err := b .ConsumeID (UpdateGroupCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#a45eb99b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupCall ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCall#a45eb99b to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#a45eb99b: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := DecodeGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#a45eb99b: field call: %w" , err )
}
u .Call = value
}
return nil
}
func (u UpdateGroupCall ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupCall {}
_ bin .Decoder = &UpdateGroupCall {}
_ bin .BareEncoder = &UpdateGroupCall {}
_ bin .BareDecoder = &UpdateGroupCall {}
_ UpdateClass = &UpdateGroupCall {}
)
type UpdatePeerHistoryTTL struct {
Flags bin .Fields
Peer PeerClass
TTLPeriod int
}
const UpdatePeerHistoryTTLTypeID = 0xbb9bb9a5
func (u *UpdatePeerHistoryTTL ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .TTLPeriod == 0 ) {
return false
}
return true
}
func (u *UpdatePeerHistoryTTL ) String () string {
if u == nil {
return "UpdatePeerHistoryTTL(nil)"
}
type Alias UpdatePeerHistoryTTL
return fmt .Sprintf ("UpdatePeerHistoryTTL%+v" , Alias (*u ))
}
func (u *UpdatePeerHistoryTTL ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetTTLPeriod () (value int , ok bool )
}) {
u .Peer = from .GetPeer ()
if val , ok := from .GetTTLPeriod (); ok {
u .TTLPeriod = val
}
}
func (*UpdatePeerHistoryTTL ) TypeID () uint32 {
return UpdatePeerHistoryTTLTypeID
}
func (*UpdatePeerHistoryTTL ) TypeName () string {
return "updatePeerHistoryTTL"
}
func (u *UpdatePeerHistoryTTL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerHistoryTTL" ,
ID : UpdatePeerHistoryTTLTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "TTLPeriod" ,
SchemaName : "ttl_period" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdatePeerHistoryTTL ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil" )
}
b .PutID (UpdatePeerHistoryTTLTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerHistoryTTL ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil" )
}
if !(u .TTLPeriod == 0 ) {
u .Flags .Set (0 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .TTLPeriod )
}
return nil
}
func (u *UpdatePeerHistoryTTL ) GetPeer () (value PeerClass ) {
return u .Peer
}
func (u *UpdatePeerHistoryTTL ) SetTTLPeriod (value int ) {
u .Flags .Set (0 )
u .TTLPeriod = value
}
func (u *UpdatePeerHistoryTTL ) GetTTLPeriod () (value int , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .TTLPeriod , true
}
func (u *UpdatePeerHistoryTTL ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerHistoryTTL#bb9bb9a5 to nil" )
}
if err := b .ConsumeID (UpdatePeerHistoryTTLTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerHistoryTTL ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerHistoryTTL#bb9bb9a5 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field flags: %w" , err )
}
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field peer: %w" , err )
}
u .Peer = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field ttl_period: %w" , err )
}
u .TTLPeriod = value
}
return nil
}
func (u UpdatePeerHistoryTTL ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerHistoryTTL {}
_ bin .Decoder = &UpdatePeerHistoryTTL {}
_ bin .BareEncoder = &UpdatePeerHistoryTTL {}
_ bin .BareDecoder = &UpdatePeerHistoryTTL {}
_ UpdateClass = &UpdatePeerHistoryTTL {}
)
type UpdateChatParticipant struct {
Flags bin .Fields
ChatID int
Date int
ActorID int
UserID int
PrevParticipant ChatParticipantClass
NewParticipant ChatParticipantClass
Invite ChatInviteExported
Qts int
}
const UpdateChatParticipantTypeID = 0xf3b3781f
func (u *UpdateChatParticipant ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .ActorID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .PrevParticipant == nil ) {
return false
}
if !(u .NewParticipant == nil ) {
return false
}
if !(u .Invite .Zero ()) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipant ) String () string {
if u == nil {
return "UpdateChatParticipant(nil)"
}
type Alias UpdateChatParticipant
return fmt .Sprintf ("UpdateChatParticipant%+v" , Alias (*u ))
}
func (u *UpdateChatParticipant ) FillFrom (from interface {
GetChatID () (value int )
GetDate () (value int )
GetActorID () (value int )
GetUserID () (value int )
GetPrevParticipant () (value ChatParticipantClass , ok bool )
GetNewParticipant () (value ChatParticipantClass , ok bool )
GetInvite () (value ChatInviteExported , ok bool )
GetQts () (value int )
}) {
u .ChatID = from .GetChatID ()
u .Date = from .GetDate ()
u .ActorID = from .GetActorID ()
u .UserID = from .GetUserID ()
if val , ok := from .GetPrevParticipant (); ok {
u .PrevParticipant = val
}
if val , ok := from .GetNewParticipant (); ok {
u .NewParticipant = val
}
if val , ok := from .GetInvite (); ok {
u .Invite = val
}
u .Qts = from .GetQts ()
}
func (*UpdateChatParticipant ) TypeID () uint32 {
return UpdateChatParticipantTypeID
}
func (*UpdateChatParticipant ) TypeName () string {
return "updateChatParticipant"
}
func (u *UpdateChatParticipant ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipant" ,
ID : UpdateChatParticipantTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "ActorID" ,
SchemaName : "actor_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "PrevParticipant" ,
SchemaName : "prev_participant" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "NewParticipant" ,
SchemaName : "new_participant" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Invite" ,
SchemaName : "invite" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateChatParticipant ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipant#f3b3781f as nil" )
}
b .PutID (UpdateChatParticipantTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipant ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipant#f3b3781f as nil" )
}
if !(u .PrevParticipant == nil ) {
u .Flags .Set (0 )
}
if !(u .NewParticipant == nil ) {
u .Flags .Set (1 )
}
if !(u .Invite .Zero ()) {
u .Flags .Set (2 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field flags: %w" , err )
}
b .PutInt (u .ChatID )
b .PutInt (u .Date )
b .PutInt (u .ActorID )
b .PutInt (u .UserID )
if u .Flags .Has (0 ) {
if u .PrevParticipant == nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field prev_participant is nil" )
}
if err := u .PrevParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field prev_participant: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .NewParticipant == nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field new_participant is nil" )
}
if err := u .NewParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field new_participant: %w" , err )
}
}
if u .Flags .Has (2 ) {
if err := u .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#f3b3781f: field invite: %w" , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateChatParticipant ) GetChatID () (value int ) {
return u .ChatID
}
func (u *UpdateChatParticipant ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateChatParticipant ) GetActorID () (value int ) {
return u .ActorID
}
func (u *UpdateChatParticipant ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateChatParticipant ) SetPrevParticipant (value ChatParticipantClass ) {
u .Flags .Set (0 )
u .PrevParticipant = value
}
func (u *UpdateChatParticipant ) GetPrevParticipant () (value ChatParticipantClass , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .PrevParticipant , true
}
func (u *UpdateChatParticipant ) SetNewParticipant (value ChatParticipantClass ) {
u .Flags .Set (1 )
u .NewParticipant = value
}
func (u *UpdateChatParticipant ) GetNewParticipant () (value ChatParticipantClass , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .NewParticipant , true
}
func (u *UpdateChatParticipant ) SetInvite (value ChatInviteExported ) {
u .Flags .Set (2 )
u .Invite = value
}
func (u *UpdateChatParticipant ) GetInvite () (value ChatInviteExported , ok bool ) {
if !u .Flags .Has (2 ) {
return value , false
}
return u .Invite , true
}
func (u *UpdateChatParticipant ) GetQts () (value int ) {
return u .Qts
}
func (u *UpdateChatParticipant ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipant#f3b3781f to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipant ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipant#f3b3781f to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field actor_id: %w" , err )
}
u .ActorID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field user_id: %w" , err )
}
u .UserID = value
}
if u .Flags .Has (0 ) {
value , err := DecodeChatParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field prev_participant: %w" , err )
}
u .PrevParticipant = value
}
if u .Flags .Has (1 ) {
value , err := DecodeChatParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field new_participant: %w" , err )
}
u .NewParticipant = value
}
if u .Flags .Has (2 ) {
if err := u .Invite .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field invite: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#f3b3781f: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u UpdateChatParticipant ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipant {}
_ bin .Decoder = &UpdateChatParticipant {}
_ bin .BareEncoder = &UpdateChatParticipant {}
_ bin .BareDecoder = &UpdateChatParticipant {}
_ UpdateClass = &UpdateChatParticipant {}
)
type UpdateChannelParticipant struct {
Flags bin .Fields
ChannelID int
Date int
ActorID int
UserID int
PrevParticipant ChannelParticipantClass
NewParticipant ChannelParticipantClass
Invite ChatInviteExported
Qts int
}
const UpdateChannelParticipantTypeID = 0x7fecb1ec
func (u *UpdateChannelParticipant ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .ActorID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .PrevParticipant == nil ) {
return false
}
if !(u .NewParticipant == nil ) {
return false
}
if !(u .Invite .Zero ()) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateChannelParticipant ) String () string {
if u == nil {
return "UpdateChannelParticipant(nil)"
}
type Alias UpdateChannelParticipant
return fmt .Sprintf ("UpdateChannelParticipant%+v" , Alias (*u ))
}
func (u *UpdateChannelParticipant ) FillFrom (from interface {
GetChannelID () (value int )
GetDate () (value int )
GetActorID () (value int )
GetUserID () (value int )
GetPrevParticipant () (value ChannelParticipantClass , ok bool )
GetNewParticipant () (value ChannelParticipantClass , ok bool )
GetInvite () (value ChatInviteExported , ok bool )
GetQts () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .Date = from .GetDate ()
u .ActorID = from .GetActorID ()
u .UserID = from .GetUserID ()
if val , ok := from .GetPrevParticipant (); ok {
u .PrevParticipant = val
}
if val , ok := from .GetNewParticipant (); ok {
u .NewParticipant = val
}
if val , ok := from .GetInvite (); ok {
u .Invite = val
}
u .Qts = from .GetQts ()
}
func (*UpdateChannelParticipant ) TypeID () uint32 {
return UpdateChannelParticipantTypeID
}
func (*UpdateChannelParticipant ) TypeName () string {
return "updateChannelParticipant"
}
func (u *UpdateChannelParticipant ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelParticipant" ,
ID : UpdateChannelParticipantTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "ActorID" ,
SchemaName : "actor_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "PrevParticipant" ,
SchemaName : "prev_participant" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "NewParticipant" ,
SchemaName : "new_participant" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Invite" ,
SchemaName : "invite" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateChannelParticipant ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelParticipant#7fecb1ec as nil" )
}
b .PutID (UpdateChannelParticipantTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelParticipant ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelParticipant#7fecb1ec as nil" )
}
if !(u .PrevParticipant == nil ) {
u .Flags .Set (0 )
}
if !(u .NewParticipant == nil ) {
u .Flags .Set (1 )
}
if !(u .Invite .Zero ()) {
u .Flags .Set (2 )
}
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field flags: %w" , err )
}
b .PutInt (u .ChannelID )
b .PutInt (u .Date )
b .PutInt (u .ActorID )
b .PutInt (u .UserID )
if u .Flags .Has (0 ) {
if u .PrevParticipant == nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field prev_participant is nil" )
}
if err := u .PrevParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field prev_participant: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .NewParticipant == nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field new_participant is nil" )
}
if err := u .NewParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field new_participant: %w" , err )
}
}
if u .Flags .Has (2 ) {
if err := u .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#7fecb1ec: field invite: %w" , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateChannelParticipant ) GetChannelID () (value int ) {
return u .ChannelID
}
func (u *UpdateChannelParticipant ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateChannelParticipant ) GetActorID () (value int ) {
return u .ActorID
}
func (u *UpdateChannelParticipant ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateChannelParticipant ) SetPrevParticipant (value ChannelParticipantClass ) {
u .Flags .Set (0 )
u .PrevParticipant = value
}
func (u *UpdateChannelParticipant ) GetPrevParticipant () (value ChannelParticipantClass , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return u .PrevParticipant , true
}
func (u *UpdateChannelParticipant ) SetNewParticipant (value ChannelParticipantClass ) {
u .Flags .Set (1 )
u .NewParticipant = value
}
func (u *UpdateChannelParticipant ) GetNewParticipant () (value ChannelParticipantClass , ok bool ) {
if !u .Flags .Has (1 ) {
return value , false
}
return u .NewParticipant , true
}
func (u *UpdateChannelParticipant ) SetInvite (value ChatInviteExported ) {
u .Flags .Set (2 )
u .Invite = value
}
func (u *UpdateChannelParticipant ) GetInvite () (value ChatInviteExported , ok bool ) {
if !u .Flags .Has (2 ) {
return value , false
}
return u .Invite , true
}
func (u *UpdateChannelParticipant ) GetQts () (value int ) {
return u .Qts
}
func (u *UpdateChannelParticipant ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelParticipant#7fecb1ec to nil" )
}
if err := b .ConsumeID (UpdateChannelParticipantTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelParticipant ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelParticipant#7fecb1ec to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field actor_id: %w" , err )
}
u .ActorID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field user_id: %w" , err )
}
u .UserID = value
}
if u .Flags .Has (0 ) {
value , err := DecodeChannelParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field prev_participant: %w" , err )
}
u .PrevParticipant = value
}
if u .Flags .Has (1 ) {
value , err := DecodeChannelParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field new_participant: %w" , err )
}
u .NewParticipant = value
}
if u .Flags .Has (2 ) {
if err := u .Invite .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field invite: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#7fecb1ec: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u UpdateChannelParticipant ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelParticipant {}
_ bin .Decoder = &UpdateChannelParticipant {}
_ bin .BareEncoder = &UpdateChannelParticipant {}
_ bin .BareDecoder = &UpdateChannelParticipant {}
_ UpdateClass = &UpdateChannelParticipant {}
)
type UpdateBotStopped struct {
UserID int
Date int
Stopped bool
Qts int
}
const UpdateBotStoppedTypeID = 0x7f9488a
func (u *UpdateBotStopped ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Stopped == false ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotStopped ) String () string {
if u == nil {
return "UpdateBotStopped(nil)"
}
type Alias UpdateBotStopped
return fmt .Sprintf ("UpdateBotStopped%+v" , Alias (*u ))
}
func (u *UpdateBotStopped ) FillFrom (from interface {
GetUserID () (value int )
GetDate () (value int )
GetStopped () (value bool )
GetQts () (value int )
}) {
u .UserID = from .GetUserID ()
u .Date = from .GetDate ()
u .Stopped = from .GetStopped ()
u .Qts = from .GetQts ()
}
func (*UpdateBotStopped ) TypeID () uint32 {
return UpdateBotStoppedTypeID
}
func (*UpdateBotStopped ) TypeName () string {
return "updateBotStopped"
}
func (u *UpdateBotStopped ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotStopped" ,
ID : UpdateBotStoppedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Stopped" ,
SchemaName : "stopped" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotStopped ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotStopped#7f9488a as nil" )
}
b .PutID (UpdateBotStoppedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotStopped ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotStopped#7f9488a as nil" )
}
b .PutInt (u .UserID )
b .PutInt (u .Date )
b .PutBool (u .Stopped )
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotStopped ) GetUserID () (value int ) {
return u .UserID
}
func (u *UpdateBotStopped ) GetDate () (value int ) {
return u .Date
}
func (u *UpdateBotStopped ) GetStopped () (value bool ) {
return u .Stopped
}
func (u *UpdateBotStopped ) GetQts () (value int ) {
return u .Qts
}
func (u *UpdateBotStopped ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotStopped#7f9488a to nil" )
}
if err := b .ConsumeID (UpdateBotStoppedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#7f9488a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotStopped ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotStopped#7f9488a to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#7f9488a: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#7f9488a: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#7f9488a: field stopped: %w" , err )
}
u .Stopped = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#7f9488a: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u UpdateBotStopped ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotStopped {}
_ bin .Decoder = &UpdateBotStopped {}
_ bin .BareEncoder = &UpdateBotStopped {}
_ bin .BareDecoder = &UpdateBotStopped {}
_ UpdateClass = &UpdateBotStopped {}
)
type UpdateClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () UpdateClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeUpdate (buf *bin .Buffer ) (UpdateClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case UpdateNewMessageTypeID :
v := UpdateNewMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessageIDTypeID :
v := UpdateMessageID {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteMessagesTypeID :
v := UpdateDeleteMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserTypingTypeID :
v := UpdateUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatUserTypingTypeID :
v := UpdateChatUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantsTypeID :
v := UpdateChatParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserStatusTypeID :
v := UpdateUserStatus {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserNameTypeID :
v := UpdateUserName {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserPhotoTypeID :
v := UpdateUserPhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewEncryptedMessageTypeID :
v := UpdateNewEncryptedMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptedChatTypingTypeID :
v := UpdateEncryptedChatTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptionTypeID :
v := UpdateEncryption {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptedMessagesReadTypeID :
v := UpdateEncryptedMessagesRead {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantAddTypeID :
v := UpdateChatParticipantAdd {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantDeleteTypeID :
v := UpdateChatParticipantDelete {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDCOptionsTypeID :
v := UpdateDCOptions {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNotifySettingsTypeID :
v := UpdateNotifySettings {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateServiceNotificationTypeID :
v := UpdateServiceNotification {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePrivacyTypeID :
v := UpdatePrivacy {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserPhoneTypeID :
v := UpdateUserPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadHistoryInboxTypeID :
v := UpdateReadHistoryInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadHistoryOutboxTypeID :
v := UpdateReadHistoryOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateWebPageTypeID :
v := UpdateWebPage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadMessagesContentsTypeID :
v := UpdateReadMessagesContents {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelTooLongTypeID :
v := UpdateChannelTooLong {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelTypeID :
v := UpdateChannel {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewChannelMessageTypeID :
v := UpdateNewChannelMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelInboxTypeID :
v := UpdateReadChannelInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteChannelMessagesTypeID :
v := UpdateDeleteChannelMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelMessageViewsTypeID :
v := UpdateChannelMessageViews {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantAdminTypeID :
v := UpdateChatParticipantAdmin {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewStickerSetTypeID :
v := UpdateNewStickerSet {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStickerSetsOrderTypeID :
v := UpdateStickerSetsOrder {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStickerSetsTypeID :
v := UpdateStickerSets {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateSavedGifsTypeID :
v := UpdateSavedGifs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotInlineQueryTypeID :
v := UpdateBotInlineQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotInlineSendTypeID :
v := UpdateBotInlineSend {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEditChannelMessageTypeID :
v := UpdateEditChannelMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotCallbackQueryTypeID :
v := UpdateBotCallbackQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEditMessageTypeID :
v := UpdateEditMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateInlineBotCallbackQueryTypeID :
v := UpdateInlineBotCallbackQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelOutboxTypeID :
v := UpdateReadChannelOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDraftMessageTypeID :
v := UpdateDraftMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadFeaturedStickersTypeID :
v := UpdateReadFeaturedStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateRecentStickersTypeID :
v := UpdateRecentStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateConfigTypeID :
v := UpdateConfig {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePtsChangedTypeID :
v := UpdatePtsChanged {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelWebPageTypeID :
v := UpdateChannelWebPage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogPinnedTypeID :
v := UpdateDialogPinned {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedDialogsTypeID :
v := UpdatePinnedDialogs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotWebhookJSONTypeID :
v := UpdateBotWebhookJSON {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotWebhookJSONQueryTypeID :
v := UpdateBotWebhookJSONQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotShippingQueryTypeID :
v := UpdateBotShippingQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotPrecheckoutQueryTypeID :
v := UpdateBotPrecheckoutQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePhoneCallTypeID :
v := UpdatePhoneCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLangPackTooLongTypeID :
v := UpdateLangPackTooLong {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLangPackTypeID :
v := UpdateLangPack {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateFavedStickersTypeID :
v := UpdateFavedStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelReadMessagesContentsTypeID :
v := UpdateChannelReadMessagesContents {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateContactsResetTypeID :
v := UpdateContactsReset {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelAvailableMessagesTypeID :
v := UpdateChannelAvailableMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogUnreadMarkTypeID :
v := UpdateDialogUnreadMark {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessagePollTypeID :
v := UpdateMessagePoll {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatDefaultBannedRightsTypeID :
v := UpdateChatDefaultBannedRights {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateFolderPeersTypeID :
v := UpdateFolderPeers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerSettingsTypeID :
v := UpdatePeerSettings {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerLocatedTypeID :
v := UpdatePeerLocated {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewScheduledMessageTypeID :
v := UpdateNewScheduledMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteScheduledMessagesTypeID :
v := UpdateDeleteScheduledMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateThemeTypeID :
v := UpdateTheme {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGeoLiveViewedTypeID :
v := UpdateGeoLiveViewed {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLoginTokenTypeID :
v := UpdateLoginToken {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessagePollVoteTypeID :
v := UpdateMessagePollVote {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFilterTypeID :
v := UpdateDialogFilter {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFilterOrderTypeID :
v := UpdateDialogFilterOrder {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFiltersTypeID :
v := UpdateDialogFilters {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePhoneCallSignalingDataTypeID :
v := UpdatePhoneCallSignalingData {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelMessageForwardsTypeID :
v := UpdateChannelMessageForwards {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelDiscussionInboxTypeID :
v := UpdateReadChannelDiscussionInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelDiscussionOutboxTypeID :
v := UpdateReadChannelDiscussionOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerBlockedTypeID :
v := UpdatePeerBlocked {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelUserTypingTypeID :
v := UpdateChannelUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedMessagesTypeID :
v := UpdatePinnedMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedChannelMessagesTypeID :
v := UpdatePinnedChannelMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatTypeID :
v := UpdateChat {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupCallParticipantsTypeID :
v := UpdateGroupCallParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupCallTypeID :
v := UpdateGroupCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerHistoryTTLTypeID :
v := UpdatePeerHistoryTTL {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantTypeID :
v := UpdateChatParticipant {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelParticipantTypeID :
v := UpdateChannelParticipant {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotStoppedTypeID :
v := UpdateBotStopped {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , bin .NewUnexpectedID (id ))
}
}
type UpdateBox struct {
Update UpdateClass
}
func (b *UpdateBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode UpdateBox to nil" )
}
v , err := DecodeUpdate (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .Update = v
return nil
}
func (b *UpdateBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .Update == nil {
return fmt .Errorf ("unable to encode UpdateClass as nil" )
}
return b .Update .Encode (buf )
}
type UpdateClassArray []UpdateClass
func (s UpdateClassArray ) Sort (less func (a , b UpdateClass ) bool ) UpdateClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateClassArray ) SortStable (less func (a , b UpdateClass ) bool ) UpdateClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateClassArray ) Retain (keep func (x UpdateClass ) bool ) UpdateClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateClassArray ) First () (v UpdateClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateClassArray ) Last () (v UpdateClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateClassArray ) PopFirst () (v UpdateClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateClassArray ) Pop () (v UpdateClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateClassArray ) AsUpdateNewMessage () (to UpdateNewMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessageID () (to UpdateMessageIDArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessageID )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteMessages () (to UpdateDeleteMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserTyping () (to UpdateUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatUserTyping () (to UpdateChatUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipants () (to UpdateChatParticipantsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipants )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserStatus () (to UpdateUserStatusArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserStatus )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserName () (to UpdateUserNameArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserName )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserPhoto () (to UpdateUserPhotoArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserPhoto )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewEncryptedMessage () (to UpdateNewEncryptedMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewEncryptedMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryptedChatTyping () (to UpdateEncryptedChatTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryptedChatTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryption () (to UpdateEncryptionArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryption )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryptedMessagesRead () (to UpdateEncryptedMessagesReadArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryptedMessagesRead )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantAdd () (to UpdateChatParticipantAddArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantAdd )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantDelete () (to UpdateChatParticipantDeleteArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantDelete )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDCOptions () (to UpdateDCOptionsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDCOptions )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNotifySettings () (to UpdateNotifySettingsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNotifySettings )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateServiceNotification () (to UpdateServiceNotificationArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateServiceNotification )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePrivacy () (to UpdatePrivacyArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePrivacy )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserPhone () (to UpdateUserPhoneArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserPhone )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadHistoryInbox () (to UpdateReadHistoryInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadHistoryInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadHistoryOutbox () (to UpdateReadHistoryOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadHistoryOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateWebPage () (to UpdateWebPageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateWebPage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadMessagesContents () (to UpdateReadMessagesContentsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadMessagesContents )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelTooLong () (to UpdateChannelTooLongArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelTooLong )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannel () (to UpdateChannelArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannel )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewChannelMessage () (to UpdateNewChannelMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewChannelMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelInbox () (to UpdateReadChannelInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteChannelMessages () (to UpdateDeleteChannelMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteChannelMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelMessageViews () (to UpdateChannelMessageViewsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelMessageViews )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantAdmin () (to UpdateChatParticipantAdminArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantAdmin )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewStickerSet () (to UpdateNewStickerSetArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewStickerSet )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStickerSetsOrder () (to UpdateStickerSetsOrderArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStickerSetsOrder )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotInlineQuery () (to UpdateBotInlineQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotInlineQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotInlineSend () (to UpdateBotInlineSendArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotInlineSend )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEditChannelMessage () (to UpdateEditChannelMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEditChannelMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotCallbackQuery () (to UpdateBotCallbackQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotCallbackQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEditMessage () (to UpdateEditMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEditMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateInlineBotCallbackQuery () (to UpdateInlineBotCallbackQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateInlineBotCallbackQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelOutbox () (to UpdateReadChannelOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDraftMessage () (to UpdateDraftMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDraftMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelWebPage () (to UpdateChannelWebPageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelWebPage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogPinned () (to UpdateDialogPinnedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogPinned )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedDialogs () (to UpdatePinnedDialogsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedDialogs )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotWebhookJSON () (to UpdateBotWebhookJSONArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotWebhookJSON )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotWebhookJSONQuery () (to UpdateBotWebhookJSONQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotWebhookJSONQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotShippingQuery () (to UpdateBotShippingQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotShippingQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotPrecheckoutQuery () (to UpdateBotPrecheckoutQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotPrecheckoutQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePhoneCall () (to UpdatePhoneCallArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePhoneCall )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateLangPackTooLong () (to UpdateLangPackTooLongArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateLangPackTooLong )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateLangPack () (to UpdateLangPackArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateLangPack )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelReadMessagesContents () (to UpdateChannelReadMessagesContentsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelReadMessagesContents )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelAvailableMessages () (to UpdateChannelAvailableMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelAvailableMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogUnreadMark () (to UpdateDialogUnreadMarkArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogUnreadMark )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessagePoll () (to UpdateMessagePollArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessagePoll )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatDefaultBannedRights () (to UpdateChatDefaultBannedRightsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatDefaultBannedRights )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateFolderPeers () (to UpdateFolderPeersArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateFolderPeers )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerSettings () (to UpdatePeerSettingsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerSettings )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerLocated () (to UpdatePeerLocatedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerLocated )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewScheduledMessage () (to UpdateNewScheduledMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewScheduledMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteScheduledMessages () (to UpdateDeleteScheduledMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteScheduledMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateTheme () (to UpdateThemeArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateTheme )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGeoLiveViewed () (to UpdateGeoLiveViewedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGeoLiveViewed )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessagePollVote () (to UpdateMessagePollVoteArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessagePollVote )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogFilter () (to UpdateDialogFilterArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogFilter )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogFilterOrder () (to UpdateDialogFilterOrderArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogFilterOrder )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePhoneCallSignalingData () (to UpdatePhoneCallSignalingDataArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePhoneCallSignalingData )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelMessageForwards () (to UpdateChannelMessageForwardsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelMessageForwards )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelDiscussionInbox () (to UpdateReadChannelDiscussionInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelDiscussionInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelDiscussionOutbox () (to UpdateReadChannelDiscussionOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelDiscussionOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerBlocked () (to UpdatePeerBlockedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerBlocked )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelUserTyping () (to UpdateChannelUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedMessages () (to UpdatePinnedMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedChannelMessages () (to UpdatePinnedChannelMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedChannelMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChat () (to UpdateChatArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChat )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupCallParticipants () (to UpdateGroupCallParticipantsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupCallParticipants )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupCall () (to UpdateGroupCallArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupCall )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerHistoryTTL () (to UpdatePeerHistoryTTLArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerHistoryTTL )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipant () (to UpdateChatParticipantArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipant )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelParticipant () (to UpdateChannelParticipantArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelParticipant )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotStopped () (to UpdateBotStoppedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotStopped )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type UpdateNewMessageArray []UpdateNewMessage
func (s UpdateNewMessageArray ) Sort (less func (a , b UpdateNewMessage ) bool ) UpdateNewMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewMessageArray ) SortStable (less func (a , b UpdateNewMessage ) bool ) UpdateNewMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewMessageArray ) Retain (keep func (x UpdateNewMessage ) bool ) UpdateNewMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewMessageArray ) First () (v UpdateNewMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewMessageArray ) Last () (v UpdateNewMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewMessageArray ) PopFirst () (v UpdateNewMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewMessageArray ) Pop () (v UpdateNewMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateMessageIDArray []UpdateMessageID
func (s UpdateMessageIDArray ) Sort (less func (a , b UpdateMessageID ) bool ) UpdateMessageIDArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageIDArray ) SortStable (less func (a , b UpdateMessageID ) bool ) UpdateMessageIDArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageIDArray ) Retain (keep func (x UpdateMessageID ) bool ) UpdateMessageIDArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessageIDArray ) First () (v UpdateMessageID , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessageIDArray ) Last () (v UpdateMessageID , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessageIDArray ) PopFirst () (v UpdateMessageID , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessageID
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessageIDArray ) Pop () (v UpdateMessageID , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateMessageIDArray ) SortByID () UpdateMessageIDArray {
return s .Sort (func (a , b UpdateMessageID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateMessageIDArray ) SortStableByID () UpdateMessageIDArray {
return s .SortStable (func (a , b UpdateMessageID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateMessageIDArray ) FillMap (to map [int ]UpdateMessageID ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateMessageIDArray ) ToMap () map [int ]UpdateMessageID {
r := make (map [int ]UpdateMessageID , len (s ))
s .FillMap (r )
return r
}
type UpdateDeleteMessagesArray []UpdateDeleteMessages
func (s UpdateDeleteMessagesArray ) Sort (less func (a , b UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteMessagesArray ) SortStable (less func (a , b UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteMessagesArray ) Retain (keep func (x UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteMessagesArray ) First () (v UpdateDeleteMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteMessagesArray ) Last () (v UpdateDeleteMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteMessagesArray ) PopFirst () (v UpdateDeleteMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteMessagesArray ) Pop () (v UpdateDeleteMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateUserTypingArray []UpdateUserTyping
func (s UpdateUserTypingArray ) Sort (less func (a , b UpdateUserTyping ) bool ) UpdateUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserTypingArray ) SortStable (less func (a , b UpdateUserTyping ) bool ) UpdateUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserTypingArray ) Retain (keep func (x UpdateUserTyping ) bool ) UpdateUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserTypingArray ) First () (v UpdateUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserTypingArray ) Last () (v UpdateUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserTypingArray ) PopFirst () (v UpdateUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserTypingArray ) Pop () (v UpdateUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChatUserTypingArray []UpdateChatUserTyping
func (s UpdateChatUserTypingArray ) Sort (less func (a , b UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatUserTypingArray ) SortStable (less func (a , b UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatUserTypingArray ) Retain (keep func (x UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatUserTypingArray ) First () (v UpdateChatUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatUserTypingArray ) Last () (v UpdateChatUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatUserTypingArray ) PopFirst () (v UpdateChatUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatUserTypingArray ) Pop () (v UpdateChatUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChatParticipantsArray []UpdateChatParticipants
func (s UpdateChatParticipantsArray ) Sort (less func (a , b UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantsArray ) SortStable (less func (a , b UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantsArray ) Retain (keep func (x UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantsArray ) First () (v UpdateChatParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantsArray ) Last () (v UpdateChatParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantsArray ) PopFirst () (v UpdateChatParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipants
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantsArray ) Pop () (v UpdateChatParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateUserStatusArray []UpdateUserStatus
func (s UpdateUserStatusArray ) Sort (less func (a , b UpdateUserStatus ) bool ) UpdateUserStatusArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserStatusArray ) SortStable (less func (a , b UpdateUserStatus ) bool ) UpdateUserStatusArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserStatusArray ) Retain (keep func (x UpdateUserStatus ) bool ) UpdateUserStatusArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserStatusArray ) First () (v UpdateUserStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserStatusArray ) Last () (v UpdateUserStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserStatusArray ) PopFirst () (v UpdateUserStatus , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserStatus
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserStatusArray ) Pop () (v UpdateUserStatus , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateUserNameArray []UpdateUserName
func (s UpdateUserNameArray ) Sort (less func (a , b UpdateUserName ) bool ) UpdateUserNameArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserNameArray ) SortStable (less func (a , b UpdateUserName ) bool ) UpdateUserNameArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserNameArray ) Retain (keep func (x UpdateUserName ) bool ) UpdateUserNameArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserNameArray ) First () (v UpdateUserName , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserNameArray ) Last () (v UpdateUserName , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserNameArray ) PopFirst () (v UpdateUserName , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserName
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserNameArray ) Pop () (v UpdateUserName , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateUserPhotoArray []UpdateUserPhoto
func (s UpdateUserPhotoArray ) Sort (less func (a , b UpdateUserPhoto ) bool ) UpdateUserPhotoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhotoArray ) SortStable (less func (a , b UpdateUserPhoto ) bool ) UpdateUserPhotoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhotoArray ) Retain (keep func (x UpdateUserPhoto ) bool ) UpdateUserPhotoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserPhotoArray ) First () (v UpdateUserPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserPhotoArray ) Last () (v UpdateUserPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserPhotoArray ) PopFirst () (v UpdateUserPhoto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserPhoto
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserPhotoArray ) Pop () (v UpdateUserPhoto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateUserPhotoArray ) SortByDate () UpdateUserPhotoArray {
return s .Sort (func (a , b UpdateUserPhoto ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateUserPhotoArray ) SortStableByDate () UpdateUserPhotoArray {
return s .SortStable (func (a , b UpdateUserPhoto ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateNewEncryptedMessageArray []UpdateNewEncryptedMessage
func (s UpdateNewEncryptedMessageArray ) Sort (less func (a , b UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewEncryptedMessageArray ) SortStable (less func (a , b UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewEncryptedMessageArray ) Retain (keep func (x UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewEncryptedMessageArray ) First () (v UpdateNewEncryptedMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewEncryptedMessageArray ) Last () (v UpdateNewEncryptedMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewEncryptedMessageArray ) PopFirst () (v UpdateNewEncryptedMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewEncryptedMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewEncryptedMessageArray ) Pop () (v UpdateNewEncryptedMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateEncryptedChatTypingArray []UpdateEncryptedChatTyping
func (s UpdateEncryptedChatTypingArray ) Sort (less func (a , b UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedChatTypingArray ) SortStable (less func (a , b UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedChatTypingArray ) Retain (keep func (x UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptedChatTypingArray ) First () (v UpdateEncryptedChatTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptedChatTypingArray ) Last () (v UpdateEncryptedChatTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptedChatTypingArray ) PopFirst () (v UpdateEncryptedChatTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryptedChatTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptedChatTypingArray ) Pop () (v UpdateEncryptedChatTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateEncryptionArray []UpdateEncryption
func (s UpdateEncryptionArray ) Sort (less func (a , b UpdateEncryption ) bool ) UpdateEncryptionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptionArray ) SortStable (less func (a , b UpdateEncryption ) bool ) UpdateEncryptionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptionArray ) Retain (keep func (x UpdateEncryption ) bool ) UpdateEncryptionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptionArray ) First () (v UpdateEncryption , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptionArray ) Last () (v UpdateEncryption , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptionArray ) PopFirst () (v UpdateEncryption , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryption
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptionArray ) Pop () (v UpdateEncryption , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateEncryptionArray ) SortByDate () UpdateEncryptionArray {
return s .Sort (func (a , b UpdateEncryption ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateEncryptionArray ) SortStableByDate () UpdateEncryptionArray {
return s .SortStable (func (a , b UpdateEncryption ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateEncryptedMessagesReadArray []UpdateEncryptedMessagesRead
func (s UpdateEncryptedMessagesReadArray ) Sort (less func (a , b UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedMessagesReadArray ) SortStable (less func (a , b UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedMessagesReadArray ) Retain (keep func (x UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptedMessagesReadArray ) First () (v UpdateEncryptedMessagesRead , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptedMessagesReadArray ) Last () (v UpdateEncryptedMessagesRead , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptedMessagesReadArray ) PopFirst () (v UpdateEncryptedMessagesRead , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryptedMessagesRead
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptedMessagesReadArray ) Pop () (v UpdateEncryptedMessagesRead , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateEncryptedMessagesReadArray ) SortByDate () UpdateEncryptedMessagesReadArray {
return s .Sort (func (a , b UpdateEncryptedMessagesRead ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateEncryptedMessagesReadArray ) SortStableByDate () UpdateEncryptedMessagesReadArray {
return s .SortStable (func (a , b UpdateEncryptedMessagesRead ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChatParticipantAddArray []UpdateChatParticipantAdd
func (s UpdateChatParticipantAddArray ) Sort (less func (a , b UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAddArray ) SortStable (less func (a , b UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAddArray ) Retain (keep func (x UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantAddArray ) First () (v UpdateChatParticipantAdd , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantAddArray ) Last () (v UpdateChatParticipantAdd , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantAddArray ) PopFirst () (v UpdateChatParticipantAdd , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantAdd
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantAddArray ) Pop () (v UpdateChatParticipantAdd , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateChatParticipantAddArray ) SortByDate () UpdateChatParticipantAddArray {
return s .Sort (func (a , b UpdateChatParticipantAdd ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChatParticipantAddArray ) SortStableByDate () UpdateChatParticipantAddArray {
return s .SortStable (func (a , b UpdateChatParticipantAdd ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChatParticipantDeleteArray []UpdateChatParticipantDelete
func (s UpdateChatParticipantDeleteArray ) Sort (less func (a , b UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantDeleteArray ) SortStable (less func (a , b UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantDeleteArray ) Retain (keep func (x UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantDeleteArray ) First () (v UpdateChatParticipantDelete , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantDeleteArray ) Last () (v UpdateChatParticipantDelete , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantDeleteArray ) PopFirst () (v UpdateChatParticipantDelete , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantDelete
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantDeleteArray ) Pop () (v UpdateChatParticipantDelete , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDCOptionsArray []UpdateDCOptions
func (s UpdateDCOptionsArray ) Sort (less func (a , b UpdateDCOptions ) bool ) UpdateDCOptionsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDCOptionsArray ) SortStable (less func (a , b UpdateDCOptions ) bool ) UpdateDCOptionsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDCOptionsArray ) Retain (keep func (x UpdateDCOptions ) bool ) UpdateDCOptionsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDCOptionsArray ) First () (v UpdateDCOptions , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDCOptionsArray ) Last () (v UpdateDCOptions , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDCOptionsArray ) PopFirst () (v UpdateDCOptions , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDCOptions
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDCOptionsArray ) Pop () (v UpdateDCOptions , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateNotifySettingsArray []UpdateNotifySettings
func (s UpdateNotifySettingsArray ) Sort (less func (a , b UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNotifySettingsArray ) SortStable (less func (a , b UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNotifySettingsArray ) Retain (keep func (x UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNotifySettingsArray ) First () (v UpdateNotifySettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNotifySettingsArray ) Last () (v UpdateNotifySettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNotifySettingsArray ) PopFirst () (v UpdateNotifySettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNotifySettings
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNotifySettingsArray ) Pop () (v UpdateNotifySettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateServiceNotificationArray []UpdateServiceNotification
func (s UpdateServiceNotificationArray ) Sort (less func (a , b UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateServiceNotificationArray ) SortStable (less func (a , b UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateServiceNotificationArray ) Retain (keep func (x UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateServiceNotificationArray ) First () (v UpdateServiceNotification , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateServiceNotificationArray ) Last () (v UpdateServiceNotification , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateServiceNotificationArray ) PopFirst () (v UpdateServiceNotification , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateServiceNotification
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateServiceNotificationArray ) Pop () (v UpdateServiceNotification , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePrivacyArray []UpdatePrivacy
func (s UpdatePrivacyArray ) Sort (less func (a , b UpdatePrivacy ) bool ) UpdatePrivacyArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePrivacyArray ) SortStable (less func (a , b UpdatePrivacy ) bool ) UpdatePrivacyArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePrivacyArray ) Retain (keep func (x UpdatePrivacy ) bool ) UpdatePrivacyArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePrivacyArray ) First () (v UpdatePrivacy , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePrivacyArray ) Last () (v UpdatePrivacy , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePrivacyArray ) PopFirst () (v UpdatePrivacy , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePrivacy
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePrivacyArray ) Pop () (v UpdatePrivacy , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateUserPhoneArray []UpdateUserPhone
func (s UpdateUserPhoneArray ) Sort (less func (a , b UpdateUserPhone ) bool ) UpdateUserPhoneArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhoneArray ) SortStable (less func (a , b UpdateUserPhone ) bool ) UpdateUserPhoneArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhoneArray ) Retain (keep func (x UpdateUserPhone ) bool ) UpdateUserPhoneArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserPhoneArray ) First () (v UpdateUserPhone , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserPhoneArray ) Last () (v UpdateUserPhone , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserPhoneArray ) PopFirst () (v UpdateUserPhone , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserPhone
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserPhoneArray ) Pop () (v UpdateUserPhone , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadHistoryInboxArray []UpdateReadHistoryInbox
func (s UpdateReadHistoryInboxArray ) Sort (less func (a , b UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryInboxArray ) SortStable (less func (a , b UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryInboxArray ) Retain (keep func (x UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadHistoryInboxArray ) First () (v UpdateReadHistoryInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadHistoryInboxArray ) Last () (v UpdateReadHistoryInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadHistoryInboxArray ) PopFirst () (v UpdateReadHistoryInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadHistoryInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadHistoryInboxArray ) Pop () (v UpdateReadHistoryInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadHistoryOutboxArray []UpdateReadHistoryOutbox
func (s UpdateReadHistoryOutboxArray ) Sort (less func (a , b UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryOutboxArray ) SortStable (less func (a , b UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryOutboxArray ) Retain (keep func (x UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadHistoryOutboxArray ) First () (v UpdateReadHistoryOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadHistoryOutboxArray ) Last () (v UpdateReadHistoryOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadHistoryOutboxArray ) PopFirst () (v UpdateReadHistoryOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadHistoryOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadHistoryOutboxArray ) Pop () (v UpdateReadHistoryOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateWebPageArray []UpdateWebPage
func (s UpdateWebPageArray ) Sort (less func (a , b UpdateWebPage ) bool ) UpdateWebPageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebPageArray ) SortStable (less func (a , b UpdateWebPage ) bool ) UpdateWebPageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebPageArray ) Retain (keep func (x UpdateWebPage ) bool ) UpdateWebPageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateWebPageArray ) First () (v UpdateWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateWebPageArray ) Last () (v UpdateWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateWebPageArray ) PopFirst () (v UpdateWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateWebPage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateWebPageArray ) Pop () (v UpdateWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadMessagesContentsArray []UpdateReadMessagesContents
func (s UpdateReadMessagesContentsArray ) Sort (less func (a , b UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadMessagesContentsArray ) SortStable (less func (a , b UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadMessagesContentsArray ) Retain (keep func (x UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadMessagesContentsArray ) First () (v UpdateReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadMessagesContentsArray ) Last () (v UpdateReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadMessagesContentsArray ) PopFirst () (v UpdateReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadMessagesContents
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadMessagesContentsArray ) Pop () (v UpdateReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelTooLongArray []UpdateChannelTooLong
func (s UpdateChannelTooLongArray ) Sort (less func (a , b UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelTooLongArray ) SortStable (less func (a , b UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelTooLongArray ) Retain (keep func (x UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelTooLongArray ) First () (v UpdateChannelTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelTooLongArray ) Last () (v UpdateChannelTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelTooLongArray ) PopFirst () (v UpdateChannelTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelTooLong
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelTooLongArray ) Pop () (v UpdateChannelTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelArray []UpdateChannel
func (s UpdateChannelArray ) Sort (less func (a , b UpdateChannel ) bool ) UpdateChannelArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelArray ) SortStable (less func (a , b UpdateChannel ) bool ) UpdateChannelArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelArray ) Retain (keep func (x UpdateChannel ) bool ) UpdateChannelArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelArray ) First () (v UpdateChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelArray ) Last () (v UpdateChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelArray ) PopFirst () (v UpdateChannel , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannel
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelArray ) Pop () (v UpdateChannel , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateNewChannelMessageArray []UpdateNewChannelMessage
func (s UpdateNewChannelMessageArray ) Sort (less func (a , b UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewChannelMessageArray ) SortStable (less func (a , b UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewChannelMessageArray ) Retain (keep func (x UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewChannelMessageArray ) First () (v UpdateNewChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewChannelMessageArray ) Last () (v UpdateNewChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewChannelMessageArray ) PopFirst () (v UpdateNewChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewChannelMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewChannelMessageArray ) Pop () (v UpdateNewChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadChannelInboxArray []UpdateReadChannelInbox
func (s UpdateReadChannelInboxArray ) Sort (less func (a , b UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelInboxArray ) SortStable (less func (a , b UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelInboxArray ) Retain (keep func (x UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelInboxArray ) First () (v UpdateReadChannelInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelInboxArray ) Last () (v UpdateReadChannelInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelInboxArray ) PopFirst () (v UpdateReadChannelInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelInboxArray ) Pop () (v UpdateReadChannelInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDeleteChannelMessagesArray []UpdateDeleteChannelMessages
func (s UpdateDeleteChannelMessagesArray ) Sort (less func (a , b UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteChannelMessagesArray ) SortStable (less func (a , b UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteChannelMessagesArray ) Retain (keep func (x UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteChannelMessagesArray ) First () (v UpdateDeleteChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteChannelMessagesArray ) Last () (v UpdateDeleteChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteChannelMessagesArray ) PopFirst () (v UpdateDeleteChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteChannelMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteChannelMessagesArray ) Pop () (v UpdateDeleteChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelMessageViewsArray []UpdateChannelMessageViews
func (s UpdateChannelMessageViewsArray ) Sort (less func (a , b UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageViewsArray ) SortStable (less func (a , b UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageViewsArray ) Retain (keep func (x UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelMessageViewsArray ) First () (v UpdateChannelMessageViews , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelMessageViewsArray ) Last () (v UpdateChannelMessageViews , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelMessageViewsArray ) PopFirst () (v UpdateChannelMessageViews , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelMessageViews
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelMessageViewsArray ) Pop () (v UpdateChannelMessageViews , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateChannelMessageViewsArray ) SortByID () UpdateChannelMessageViewsArray {
return s .Sort (func (a , b UpdateChannelMessageViews ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageViewsArray ) SortStableByID () UpdateChannelMessageViewsArray {
return s .SortStable (func (a , b UpdateChannelMessageViews ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageViewsArray ) FillMap (to map [int ]UpdateChannelMessageViews ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateChannelMessageViewsArray ) ToMap () map [int ]UpdateChannelMessageViews {
r := make (map [int ]UpdateChannelMessageViews , len (s ))
s .FillMap (r )
return r
}
type UpdateChatParticipantAdminArray []UpdateChatParticipantAdmin
func (s UpdateChatParticipantAdminArray ) Sort (less func (a , b UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAdminArray ) SortStable (less func (a , b UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAdminArray ) Retain (keep func (x UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantAdminArray ) First () (v UpdateChatParticipantAdmin , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantAdminArray ) Last () (v UpdateChatParticipantAdmin , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantAdminArray ) PopFirst () (v UpdateChatParticipantAdmin , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantAdmin
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantAdminArray ) Pop () (v UpdateChatParticipantAdmin , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateNewStickerSetArray []UpdateNewStickerSet
func (s UpdateNewStickerSetArray ) Sort (less func (a , b UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewStickerSetArray ) SortStable (less func (a , b UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewStickerSetArray ) Retain (keep func (x UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewStickerSetArray ) First () (v UpdateNewStickerSet , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewStickerSetArray ) Last () (v UpdateNewStickerSet , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewStickerSetArray ) PopFirst () (v UpdateNewStickerSet , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewStickerSet
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewStickerSetArray ) Pop () (v UpdateNewStickerSet , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateStickerSetsOrderArray []UpdateStickerSetsOrder
func (s UpdateStickerSetsOrderArray ) Sort (less func (a , b UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsOrderArray ) SortStable (less func (a , b UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsOrderArray ) Retain (keep func (x UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStickerSetsOrderArray ) First () (v UpdateStickerSetsOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStickerSetsOrderArray ) Last () (v UpdateStickerSetsOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStickerSetsOrderArray ) PopFirst () (v UpdateStickerSetsOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStickerSetsOrder
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStickerSetsOrderArray ) Pop () (v UpdateStickerSetsOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotInlineQueryArray []UpdateBotInlineQuery
func (s UpdateBotInlineQueryArray ) Sort (less func (a , b UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineQueryArray ) SortStable (less func (a , b UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineQueryArray ) Retain (keep func (x UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotInlineQueryArray ) First () (v UpdateBotInlineQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotInlineQueryArray ) Last () (v UpdateBotInlineQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotInlineQueryArray ) PopFirst () (v UpdateBotInlineQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotInlineQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotInlineQueryArray ) Pop () (v UpdateBotInlineQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotInlineSendArray []UpdateBotInlineSend
func (s UpdateBotInlineSendArray ) Sort (less func (a , b UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineSendArray ) SortStable (less func (a , b UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineSendArray ) Retain (keep func (x UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotInlineSendArray ) First () (v UpdateBotInlineSend , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotInlineSendArray ) Last () (v UpdateBotInlineSend , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotInlineSendArray ) PopFirst () (v UpdateBotInlineSend , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotInlineSend
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotInlineSendArray ) Pop () (v UpdateBotInlineSend , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateEditChannelMessageArray []UpdateEditChannelMessage
func (s UpdateEditChannelMessageArray ) Sort (less func (a , b UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditChannelMessageArray ) SortStable (less func (a , b UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditChannelMessageArray ) Retain (keep func (x UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEditChannelMessageArray ) First () (v UpdateEditChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEditChannelMessageArray ) Last () (v UpdateEditChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEditChannelMessageArray ) PopFirst () (v UpdateEditChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEditChannelMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEditChannelMessageArray ) Pop () (v UpdateEditChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotCallbackQueryArray []UpdateBotCallbackQuery
func (s UpdateBotCallbackQueryArray ) Sort (less func (a , b UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCallbackQueryArray ) SortStable (less func (a , b UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCallbackQueryArray ) Retain (keep func (x UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotCallbackQueryArray ) First () (v UpdateBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotCallbackQueryArray ) Last () (v UpdateBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotCallbackQueryArray ) PopFirst () (v UpdateBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotCallbackQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotCallbackQueryArray ) Pop () (v UpdateBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateEditMessageArray []UpdateEditMessage
func (s UpdateEditMessageArray ) Sort (less func (a , b UpdateEditMessage ) bool ) UpdateEditMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditMessageArray ) SortStable (less func (a , b UpdateEditMessage ) bool ) UpdateEditMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditMessageArray ) Retain (keep func (x UpdateEditMessage ) bool ) UpdateEditMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEditMessageArray ) First () (v UpdateEditMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEditMessageArray ) Last () (v UpdateEditMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEditMessageArray ) PopFirst () (v UpdateEditMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEditMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEditMessageArray ) Pop () (v UpdateEditMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateInlineBotCallbackQueryArray []UpdateInlineBotCallbackQuery
func (s UpdateInlineBotCallbackQueryArray ) Sort (less func (a , b UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateInlineBotCallbackQueryArray ) SortStable (less func (a , b UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateInlineBotCallbackQueryArray ) Retain (keep func (x UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateInlineBotCallbackQueryArray ) First () (v UpdateInlineBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateInlineBotCallbackQueryArray ) Last () (v UpdateInlineBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateInlineBotCallbackQueryArray ) PopFirst () (v UpdateInlineBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateInlineBotCallbackQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateInlineBotCallbackQueryArray ) Pop () (v UpdateInlineBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadChannelOutboxArray []UpdateReadChannelOutbox
func (s UpdateReadChannelOutboxArray ) Sort (less func (a , b UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelOutboxArray ) SortStable (less func (a , b UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelOutboxArray ) Retain (keep func (x UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelOutboxArray ) First () (v UpdateReadChannelOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelOutboxArray ) Last () (v UpdateReadChannelOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelOutboxArray ) PopFirst () (v UpdateReadChannelOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelOutboxArray ) Pop () (v UpdateReadChannelOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDraftMessageArray []UpdateDraftMessage
func (s UpdateDraftMessageArray ) Sort (less func (a , b UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDraftMessageArray ) SortStable (less func (a , b UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDraftMessageArray ) Retain (keep func (x UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDraftMessageArray ) First () (v UpdateDraftMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDraftMessageArray ) Last () (v UpdateDraftMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDraftMessageArray ) PopFirst () (v UpdateDraftMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDraftMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDraftMessageArray ) Pop () (v UpdateDraftMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelWebPageArray []UpdateChannelWebPage
func (s UpdateChannelWebPageArray ) Sort (less func (a , b UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelWebPageArray ) SortStable (less func (a , b UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelWebPageArray ) Retain (keep func (x UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelWebPageArray ) First () (v UpdateChannelWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelWebPageArray ) Last () (v UpdateChannelWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelWebPageArray ) PopFirst () (v UpdateChannelWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelWebPage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelWebPageArray ) Pop () (v UpdateChannelWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDialogPinnedArray []UpdateDialogPinned
func (s UpdateDialogPinnedArray ) Sort (less func (a , b UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogPinnedArray ) SortStable (less func (a , b UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogPinnedArray ) Retain (keep func (x UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogPinnedArray ) First () (v UpdateDialogPinned , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogPinnedArray ) Last () (v UpdateDialogPinned , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogPinnedArray ) PopFirst () (v UpdateDialogPinned , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogPinned
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogPinnedArray ) Pop () (v UpdateDialogPinned , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePinnedDialogsArray []UpdatePinnedDialogs
func (s UpdatePinnedDialogsArray ) Sort (less func (a , b UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedDialogsArray ) SortStable (less func (a , b UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedDialogsArray ) Retain (keep func (x UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedDialogsArray ) First () (v UpdatePinnedDialogs , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedDialogsArray ) Last () (v UpdatePinnedDialogs , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedDialogsArray ) PopFirst () (v UpdatePinnedDialogs , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedDialogs
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedDialogsArray ) Pop () (v UpdatePinnedDialogs , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotWebhookJSONArray []UpdateBotWebhookJSON
func (s UpdateBotWebhookJSONArray ) Sort (less func (a , b UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONArray ) SortStable (less func (a , b UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONArray ) Retain (keep func (x UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotWebhookJSONArray ) First () (v UpdateBotWebhookJSON , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotWebhookJSONArray ) Last () (v UpdateBotWebhookJSON , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotWebhookJSONArray ) PopFirst () (v UpdateBotWebhookJSON , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotWebhookJSON
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotWebhookJSONArray ) Pop () (v UpdateBotWebhookJSON , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotWebhookJSONQueryArray []UpdateBotWebhookJSONQuery
func (s UpdateBotWebhookJSONQueryArray ) Sort (less func (a , b UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONQueryArray ) SortStable (less func (a , b UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONQueryArray ) Retain (keep func (x UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotWebhookJSONQueryArray ) First () (v UpdateBotWebhookJSONQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotWebhookJSONQueryArray ) Last () (v UpdateBotWebhookJSONQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotWebhookJSONQueryArray ) PopFirst () (v UpdateBotWebhookJSONQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotWebhookJSONQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotWebhookJSONQueryArray ) Pop () (v UpdateBotWebhookJSONQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotShippingQueryArray []UpdateBotShippingQuery
func (s UpdateBotShippingQueryArray ) Sort (less func (a , b UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotShippingQueryArray ) SortStable (less func (a , b UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotShippingQueryArray ) Retain (keep func (x UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotShippingQueryArray ) First () (v UpdateBotShippingQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotShippingQueryArray ) Last () (v UpdateBotShippingQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotShippingQueryArray ) PopFirst () (v UpdateBotShippingQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotShippingQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotShippingQueryArray ) Pop () (v UpdateBotShippingQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateBotPrecheckoutQueryArray []UpdateBotPrecheckoutQuery
func (s UpdateBotPrecheckoutQueryArray ) Sort (less func (a , b UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotPrecheckoutQueryArray ) SortStable (less func (a , b UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotPrecheckoutQueryArray ) Retain (keep func (x UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotPrecheckoutQueryArray ) First () (v UpdateBotPrecheckoutQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotPrecheckoutQueryArray ) Last () (v UpdateBotPrecheckoutQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotPrecheckoutQueryArray ) PopFirst () (v UpdateBotPrecheckoutQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotPrecheckoutQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotPrecheckoutQueryArray ) Pop () (v UpdateBotPrecheckoutQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePhoneCallArray []UpdatePhoneCall
func (s UpdatePhoneCallArray ) Sort (less func (a , b UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallArray ) SortStable (less func (a , b UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallArray ) Retain (keep func (x UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePhoneCallArray ) First () (v UpdatePhoneCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePhoneCallArray ) Last () (v UpdatePhoneCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePhoneCallArray ) PopFirst () (v UpdatePhoneCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePhoneCall
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePhoneCallArray ) Pop () (v UpdatePhoneCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateLangPackTooLongArray []UpdateLangPackTooLong
func (s UpdateLangPackTooLongArray ) Sort (less func (a , b UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackTooLongArray ) SortStable (less func (a , b UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackTooLongArray ) Retain (keep func (x UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateLangPackTooLongArray ) First () (v UpdateLangPackTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateLangPackTooLongArray ) Last () (v UpdateLangPackTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateLangPackTooLongArray ) PopFirst () (v UpdateLangPackTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateLangPackTooLong
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateLangPackTooLongArray ) Pop () (v UpdateLangPackTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateLangPackArray []UpdateLangPack
func (s UpdateLangPackArray ) Sort (less func (a , b UpdateLangPack ) bool ) UpdateLangPackArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackArray ) SortStable (less func (a , b UpdateLangPack ) bool ) UpdateLangPackArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackArray ) Retain (keep func (x UpdateLangPack ) bool ) UpdateLangPackArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateLangPackArray ) First () (v UpdateLangPack , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateLangPackArray ) Last () (v UpdateLangPack , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateLangPackArray ) PopFirst () (v UpdateLangPack , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateLangPack
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateLangPackArray ) Pop () (v UpdateLangPack , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelReadMessagesContentsArray []UpdateChannelReadMessagesContents
func (s UpdateChannelReadMessagesContentsArray ) Sort (less func (a , b UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelReadMessagesContentsArray ) SortStable (less func (a , b UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelReadMessagesContentsArray ) Retain (keep func (x UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelReadMessagesContentsArray ) First () (v UpdateChannelReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelReadMessagesContentsArray ) Last () (v UpdateChannelReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelReadMessagesContentsArray ) PopFirst () (v UpdateChannelReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelReadMessagesContents
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelReadMessagesContentsArray ) Pop () (v UpdateChannelReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelAvailableMessagesArray []UpdateChannelAvailableMessages
func (s UpdateChannelAvailableMessagesArray ) Sort (less func (a , b UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelAvailableMessagesArray ) SortStable (less func (a , b UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelAvailableMessagesArray ) Retain (keep func (x UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelAvailableMessagesArray ) First () (v UpdateChannelAvailableMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelAvailableMessagesArray ) Last () (v UpdateChannelAvailableMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelAvailableMessagesArray ) PopFirst () (v UpdateChannelAvailableMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelAvailableMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelAvailableMessagesArray ) Pop () (v UpdateChannelAvailableMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDialogUnreadMarkArray []UpdateDialogUnreadMark
func (s UpdateDialogUnreadMarkArray ) Sort (less func (a , b UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogUnreadMarkArray ) SortStable (less func (a , b UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogUnreadMarkArray ) Retain (keep func (x UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogUnreadMarkArray ) First () (v UpdateDialogUnreadMark , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogUnreadMarkArray ) Last () (v UpdateDialogUnreadMark , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogUnreadMarkArray ) PopFirst () (v UpdateDialogUnreadMark , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogUnreadMark
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogUnreadMarkArray ) Pop () (v UpdateDialogUnreadMark , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateMessagePollArray []UpdateMessagePoll
func (s UpdateMessagePollArray ) Sort (less func (a , b UpdateMessagePoll ) bool ) UpdateMessagePollArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollArray ) SortStable (less func (a , b UpdateMessagePoll ) bool ) UpdateMessagePollArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollArray ) Retain (keep func (x UpdateMessagePoll ) bool ) UpdateMessagePollArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessagePollArray ) First () (v UpdateMessagePoll , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessagePollArray ) Last () (v UpdateMessagePoll , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessagePollArray ) PopFirst () (v UpdateMessagePoll , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessagePoll
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessagePollArray ) Pop () (v UpdateMessagePoll , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChatDefaultBannedRightsArray []UpdateChatDefaultBannedRights
func (s UpdateChatDefaultBannedRightsArray ) Sort (less func (a , b UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatDefaultBannedRightsArray ) SortStable (less func (a , b UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatDefaultBannedRightsArray ) Retain (keep func (x UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatDefaultBannedRightsArray ) First () (v UpdateChatDefaultBannedRights , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatDefaultBannedRightsArray ) Last () (v UpdateChatDefaultBannedRights , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatDefaultBannedRightsArray ) PopFirst () (v UpdateChatDefaultBannedRights , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatDefaultBannedRights
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatDefaultBannedRightsArray ) Pop () (v UpdateChatDefaultBannedRights , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateFolderPeersArray []UpdateFolderPeers
func (s UpdateFolderPeersArray ) Sort (less func (a , b UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateFolderPeersArray ) SortStable (less func (a , b UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateFolderPeersArray ) Retain (keep func (x UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateFolderPeersArray ) First () (v UpdateFolderPeers , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateFolderPeersArray ) Last () (v UpdateFolderPeers , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateFolderPeersArray ) PopFirst () (v UpdateFolderPeers , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateFolderPeers
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateFolderPeersArray ) Pop () (v UpdateFolderPeers , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePeerSettingsArray []UpdatePeerSettings
func (s UpdatePeerSettingsArray ) Sort (less func (a , b UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerSettingsArray ) SortStable (less func (a , b UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerSettingsArray ) Retain (keep func (x UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerSettingsArray ) First () (v UpdatePeerSettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerSettingsArray ) Last () (v UpdatePeerSettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerSettingsArray ) PopFirst () (v UpdatePeerSettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerSettings
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerSettingsArray ) Pop () (v UpdatePeerSettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePeerLocatedArray []UpdatePeerLocated
func (s UpdatePeerLocatedArray ) Sort (less func (a , b UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerLocatedArray ) SortStable (less func (a , b UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerLocatedArray ) Retain (keep func (x UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerLocatedArray ) First () (v UpdatePeerLocated , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerLocatedArray ) Last () (v UpdatePeerLocated , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerLocatedArray ) PopFirst () (v UpdatePeerLocated , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerLocated
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerLocatedArray ) Pop () (v UpdatePeerLocated , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateNewScheduledMessageArray []UpdateNewScheduledMessage
func (s UpdateNewScheduledMessageArray ) Sort (less func (a , b UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewScheduledMessageArray ) SortStable (less func (a , b UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewScheduledMessageArray ) Retain (keep func (x UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewScheduledMessageArray ) First () (v UpdateNewScheduledMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewScheduledMessageArray ) Last () (v UpdateNewScheduledMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewScheduledMessageArray ) PopFirst () (v UpdateNewScheduledMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewScheduledMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewScheduledMessageArray ) Pop () (v UpdateNewScheduledMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDeleteScheduledMessagesArray []UpdateDeleteScheduledMessages
func (s UpdateDeleteScheduledMessagesArray ) Sort (less func (a , b UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteScheduledMessagesArray ) SortStable (less func (a , b UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteScheduledMessagesArray ) Retain (keep func (x UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteScheduledMessagesArray ) First () (v UpdateDeleteScheduledMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteScheduledMessagesArray ) Last () (v UpdateDeleteScheduledMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteScheduledMessagesArray ) PopFirst () (v UpdateDeleteScheduledMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteScheduledMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteScheduledMessagesArray ) Pop () (v UpdateDeleteScheduledMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateThemeArray []UpdateTheme
func (s UpdateThemeArray ) Sort (less func (a , b UpdateTheme ) bool ) UpdateThemeArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateThemeArray ) SortStable (less func (a , b UpdateTheme ) bool ) UpdateThemeArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateThemeArray ) Retain (keep func (x UpdateTheme ) bool ) UpdateThemeArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateThemeArray ) First () (v UpdateTheme , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateThemeArray ) Last () (v UpdateTheme , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateThemeArray ) PopFirst () (v UpdateTheme , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateTheme
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateThemeArray ) Pop () (v UpdateTheme , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateGeoLiveViewedArray []UpdateGeoLiveViewed
func (s UpdateGeoLiveViewedArray ) Sort (less func (a , b UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGeoLiveViewedArray ) SortStable (less func (a , b UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGeoLiveViewedArray ) Retain (keep func (x UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGeoLiveViewedArray ) First () (v UpdateGeoLiveViewed , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGeoLiveViewedArray ) Last () (v UpdateGeoLiveViewed , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGeoLiveViewedArray ) PopFirst () (v UpdateGeoLiveViewed , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGeoLiveViewed
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGeoLiveViewedArray ) Pop () (v UpdateGeoLiveViewed , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateMessagePollVoteArray []UpdateMessagePollVote
func (s UpdateMessagePollVoteArray ) Sort (less func (a , b UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollVoteArray ) SortStable (less func (a , b UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollVoteArray ) Retain (keep func (x UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessagePollVoteArray ) First () (v UpdateMessagePollVote , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessagePollVoteArray ) Last () (v UpdateMessagePollVote , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessagePollVoteArray ) PopFirst () (v UpdateMessagePollVote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessagePollVote
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessagePollVoteArray ) Pop () (v UpdateMessagePollVote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateDialogFilterArray []UpdateDialogFilter
func (s UpdateDialogFilterArray ) Sort (less func (a , b UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterArray ) SortStable (less func (a , b UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterArray ) Retain (keep func (x UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogFilterArray ) First () (v UpdateDialogFilter , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogFilterArray ) Last () (v UpdateDialogFilter , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogFilterArray ) PopFirst () (v UpdateDialogFilter , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogFilter
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogFilterArray ) Pop () (v UpdateDialogFilter , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateDialogFilterArray ) SortByID () UpdateDialogFilterArray {
return s .Sort (func (a , b UpdateDialogFilter ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateDialogFilterArray ) SortStableByID () UpdateDialogFilterArray {
return s .SortStable (func (a , b UpdateDialogFilter ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateDialogFilterArray ) FillMap (to map [int ]UpdateDialogFilter ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateDialogFilterArray ) ToMap () map [int ]UpdateDialogFilter {
r := make (map [int ]UpdateDialogFilter , len (s ))
s .FillMap (r )
return r
}
type UpdateDialogFilterOrderArray []UpdateDialogFilterOrder
func (s UpdateDialogFilterOrderArray ) Sort (less func (a , b UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterOrderArray ) SortStable (less func (a , b UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterOrderArray ) Retain (keep func (x UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogFilterOrderArray ) First () (v UpdateDialogFilterOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogFilterOrderArray ) Last () (v UpdateDialogFilterOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogFilterOrderArray ) PopFirst () (v UpdateDialogFilterOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogFilterOrder
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogFilterOrderArray ) Pop () (v UpdateDialogFilterOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePhoneCallSignalingDataArray []UpdatePhoneCallSignalingData
func (s UpdatePhoneCallSignalingDataArray ) Sort (less func (a , b UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallSignalingDataArray ) SortStable (less func (a , b UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallSignalingDataArray ) Retain (keep func (x UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePhoneCallSignalingDataArray ) First () (v UpdatePhoneCallSignalingData , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePhoneCallSignalingDataArray ) Last () (v UpdatePhoneCallSignalingData , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePhoneCallSignalingDataArray ) PopFirst () (v UpdatePhoneCallSignalingData , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePhoneCallSignalingData
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePhoneCallSignalingDataArray ) Pop () (v UpdatePhoneCallSignalingData , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelMessageForwardsArray []UpdateChannelMessageForwards
func (s UpdateChannelMessageForwardsArray ) Sort (less func (a , b UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageForwardsArray ) SortStable (less func (a , b UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageForwardsArray ) Retain (keep func (x UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelMessageForwardsArray ) First () (v UpdateChannelMessageForwards , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelMessageForwardsArray ) Last () (v UpdateChannelMessageForwards , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelMessageForwardsArray ) PopFirst () (v UpdateChannelMessageForwards , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelMessageForwards
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelMessageForwardsArray ) Pop () (v UpdateChannelMessageForwards , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateChannelMessageForwardsArray ) SortByID () UpdateChannelMessageForwardsArray {
return s .Sort (func (a , b UpdateChannelMessageForwards ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageForwardsArray ) SortStableByID () UpdateChannelMessageForwardsArray {
return s .SortStable (func (a , b UpdateChannelMessageForwards ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageForwardsArray ) FillMap (to map [int ]UpdateChannelMessageForwards ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateChannelMessageForwardsArray ) ToMap () map [int ]UpdateChannelMessageForwards {
r := make (map [int ]UpdateChannelMessageForwards , len (s ))
s .FillMap (r )
return r
}
type UpdateReadChannelDiscussionInboxArray []UpdateReadChannelDiscussionInbox
func (s UpdateReadChannelDiscussionInboxArray ) Sort (less func (a , b UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) SortStable (less func (a , b UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) Retain (keep func (x UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) First () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelDiscussionInboxArray ) Last () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelDiscussionInboxArray ) PopFirst () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelDiscussionInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelDiscussionInboxArray ) Pop () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateReadChannelDiscussionOutboxArray []UpdateReadChannelDiscussionOutbox
func (s UpdateReadChannelDiscussionOutboxArray ) Sort (less func (a , b UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) SortStable (less func (a , b UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) Retain (keep func (x UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) First () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelDiscussionOutboxArray ) Last () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelDiscussionOutboxArray ) PopFirst () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelDiscussionOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelDiscussionOutboxArray ) Pop () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePeerBlockedArray []UpdatePeerBlocked
func (s UpdatePeerBlockedArray ) Sort (less func (a , b UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerBlockedArray ) SortStable (less func (a , b UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerBlockedArray ) Retain (keep func (x UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerBlockedArray ) First () (v UpdatePeerBlocked , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerBlockedArray ) Last () (v UpdatePeerBlocked , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerBlockedArray ) PopFirst () (v UpdatePeerBlocked , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerBlocked
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerBlockedArray ) Pop () (v UpdatePeerBlocked , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChannelUserTypingArray []UpdateChannelUserTyping
func (s UpdateChannelUserTypingArray ) Sort (less func (a , b UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelUserTypingArray ) SortStable (less func (a , b UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelUserTypingArray ) Retain (keep func (x UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelUserTypingArray ) First () (v UpdateChannelUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelUserTypingArray ) Last () (v UpdateChannelUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelUserTypingArray ) PopFirst () (v UpdateChannelUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelUserTypingArray ) Pop () (v UpdateChannelUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePinnedMessagesArray []UpdatePinnedMessages
func (s UpdatePinnedMessagesArray ) Sort (less func (a , b UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedMessagesArray ) SortStable (less func (a , b UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedMessagesArray ) Retain (keep func (x UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedMessagesArray ) First () (v UpdatePinnedMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedMessagesArray ) Last () (v UpdatePinnedMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedMessagesArray ) PopFirst () (v UpdatePinnedMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedMessagesArray ) Pop () (v UpdatePinnedMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePinnedChannelMessagesArray []UpdatePinnedChannelMessages
func (s UpdatePinnedChannelMessagesArray ) Sort (less func (a , b UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedChannelMessagesArray ) SortStable (less func (a , b UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedChannelMessagesArray ) Retain (keep func (x UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedChannelMessagesArray ) First () (v UpdatePinnedChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedChannelMessagesArray ) Last () (v UpdatePinnedChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedChannelMessagesArray ) PopFirst () (v UpdatePinnedChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedChannelMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedChannelMessagesArray ) Pop () (v UpdatePinnedChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChatArray []UpdateChat
func (s UpdateChatArray ) Sort (less func (a , b UpdateChat ) bool ) UpdateChatArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatArray ) SortStable (less func (a , b UpdateChat ) bool ) UpdateChatArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatArray ) Retain (keep func (x UpdateChat ) bool ) UpdateChatArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatArray ) First () (v UpdateChat , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatArray ) Last () (v UpdateChat , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatArray ) PopFirst () (v UpdateChat , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChat
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatArray ) Pop () (v UpdateChat , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateGroupCallParticipantsArray []UpdateGroupCallParticipants
func (s UpdateGroupCallParticipantsArray ) Sort (less func (a , b UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallParticipantsArray ) SortStable (less func (a , b UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallParticipantsArray ) Retain (keep func (x UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupCallParticipantsArray ) First () (v UpdateGroupCallParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupCallParticipantsArray ) Last () (v UpdateGroupCallParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupCallParticipantsArray ) PopFirst () (v UpdateGroupCallParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupCallParticipants
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupCallParticipantsArray ) Pop () (v UpdateGroupCallParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateGroupCallArray []UpdateGroupCall
func (s UpdateGroupCallArray ) Sort (less func (a , b UpdateGroupCall ) bool ) UpdateGroupCallArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallArray ) SortStable (less func (a , b UpdateGroupCall ) bool ) UpdateGroupCallArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallArray ) Retain (keep func (x UpdateGroupCall ) bool ) UpdateGroupCallArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupCallArray ) First () (v UpdateGroupCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupCallArray ) Last () (v UpdateGroupCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupCallArray ) PopFirst () (v UpdateGroupCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupCall
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupCallArray ) Pop () (v UpdateGroupCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdatePeerHistoryTTLArray []UpdatePeerHistoryTTL
func (s UpdatePeerHistoryTTLArray ) Sort (less func (a , b UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerHistoryTTLArray ) SortStable (less func (a , b UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerHistoryTTLArray ) Retain (keep func (x UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerHistoryTTLArray ) First () (v UpdatePeerHistoryTTL , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerHistoryTTLArray ) Last () (v UpdatePeerHistoryTTL , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerHistoryTTLArray ) PopFirst () (v UpdatePeerHistoryTTL , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerHistoryTTL
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerHistoryTTLArray ) Pop () (v UpdatePeerHistoryTTL , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type UpdateChatParticipantArray []UpdateChatParticipant
func (s UpdateChatParticipantArray ) Sort (less func (a , b UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantArray ) SortStable (less func (a , b UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantArray ) Retain (keep func (x UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantArray ) First () (v UpdateChatParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantArray ) Last () (v UpdateChatParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantArray ) PopFirst () (v UpdateChatParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipant
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantArray ) Pop () (v UpdateChatParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateChatParticipantArray ) SortByDate () UpdateChatParticipantArray {
return s .Sort (func (a , b UpdateChatParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChatParticipantArray ) SortStableByDate () UpdateChatParticipantArray {
return s .SortStable (func (a , b UpdateChatParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChannelParticipantArray []UpdateChannelParticipant
func (s UpdateChannelParticipantArray ) Sort (less func (a , b UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelParticipantArray ) SortStable (less func (a , b UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelParticipantArray ) Retain (keep func (x UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelParticipantArray ) First () (v UpdateChannelParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelParticipantArray ) Last () (v UpdateChannelParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelParticipantArray ) PopFirst () (v UpdateChannelParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelParticipant
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelParticipantArray ) Pop () (v UpdateChannelParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateChannelParticipantArray ) SortByDate () UpdateChannelParticipantArray {
return s .Sort (func (a , b UpdateChannelParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChannelParticipantArray ) SortStableByDate () UpdateChannelParticipantArray {
return s .SortStable (func (a , b UpdateChannelParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateBotStoppedArray []UpdateBotStopped
func (s UpdateBotStoppedArray ) Sort (less func (a , b UpdateBotStopped ) bool ) UpdateBotStoppedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotStoppedArray ) SortStable (less func (a , b UpdateBotStopped ) bool ) UpdateBotStoppedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotStoppedArray ) Retain (keep func (x UpdateBotStopped ) bool ) UpdateBotStoppedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotStoppedArray ) First () (v UpdateBotStopped , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotStoppedArray ) Last () (v UpdateBotStopped , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotStoppedArray ) PopFirst () (v UpdateBotStopped , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotStopped
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotStoppedArray ) Pop () (v UpdateBotStopped , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s UpdateBotStoppedArray ) SortByDate () UpdateBotStoppedArray {
return s .Sort (func (a , b UpdateBotStopped ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateBotStoppedArray ) SortStableByDate () UpdateBotStoppedArray {
return s .SortStable (func (a , b UpdateBotStopped ) bool {
return a .GetDate () < b .GetDate ()
})
}
The pages are generated with Golds v0.3.6 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .